Oracle Database 12c has introduced new enhancements and additions to the Recovery Manager (RMAN). The new features provide both convenience and improved functionality where users don’t need to switch between RMAN and SQL* Plus prompts during Backup & Recovery, Administration etc.
Oracle Database 12c has introduced new enhancements and additions to the Recovery Manager (RMAN). The Recovery Manager continues to improve and extend the reliability, efficiency, and availability of Oracle Database backup and recovery. In this blog, I am going to provide an overview of new RMAN features that were introduced in Oracle Database 12c.
I will be covering the following two features in depth:
- SQL Interface Improvements
- SYSBACKUP Privilege
Image Source: Oracle Docs (https://docs.oracle.com/database/121/BRADV/img/GUID-9E261AF3-F0DB-4412-A456-B2BE437D9FC3-default.gif)
SQL Interface Improvements
The command line interface of RMAN has been simplified with respect to using SQL. In Oracle 12c, you can run SQL commands in RMAN without preceding the command with the SQL keyword. You also are no longer required to enclose the SQL command in quotes.
The examples given below highlight the SQL Interface Improvements: The RMAN DESCRIBE provides the same functionality as the SQL*Plus DESCRIBE:
RMAN> desc dba_profiles;
Name Null? Type
PROFILE NOT NULL VARCHAR2(128)
RESOURCE_NAME NOT NULL VARCHAR2(32)
You can run SQL statements from RMAN command prompt as shown below:
RMAN> select sysdate from dual;
You can run DDL/DML Commands from the RMAN Command prompt:
RMAN> create table test(col1 number, col2 varchar2(20));
RMAN> insert into test values (1,'Test');
RMAN> update test set col1=2;
RMAN> select * from test;
RMAN> drop table test;
The user can SHUTDOWN/STARTUP the database and can also use the ALTER command:
RMAN> shutdown immediate
Oracle instance shut down
RMAN> startup mount
connected to target database (not started)
Oracle instance started
Total System Global Area 1610612736 bytes
Fixed Size 2924928 bytes
Variable Size 520097408 bytes
Database Buffers 1073741824 bytes
Redo Buffers 13848576 bytes
RMAN> alter database open;
With this new SQL Interface enhancement, users do not need to switch between RMAN and SQL* Plus prompts during the Backup, Recovery and Administration.
Prior to 12c, users needed SYSDBA privileges to take the backup of the database. The new SYSBACKUP privilege allows the user to perform only backup operations.
The SYSBACKUP privilege allows the DBA to perform RMAN backup commands without additional privileges. Using this new role in 12c, you can segregate administration and backup operations.
With RMAN you have the same authentication options that are available with SQL*Plus:
- The Operating system authentication
- The password file authentication
To connect to RMAN using the Operating system Authentication with the SYSBACKUP Privilege use the following command:
$ rman target ' "/ as sysbackup" '
For authentication with the SYSDBA Privilege use:
$ rman target ' "/ as sysdba" '
You can also implicitly connect using the below command
$ rman target /
To Connect to RMAN using Password file Authentication with the SYSBACKUP Privilege use give the following command:
$ rman target1 ‘ “bkpadm@DB1 as sysbackup” ‘
Note that the SYSBACKUP does not provide data access privileges, such as SELECT ANY TABLE. When you don’t specify the role explicitly then the default used is AS SYSDBA.
You can leverage these new enhancements and additions in RMAN for efficient backup & recovery. The new features provide both convenience and improved functionality where users don’t need to switch between RMAN and SQL* Plus prompts during Backup & Recovery, Administration etc.