Dear Readers,
In this article, we will see the following RMAN Enhancements in Oracle 12c.
1.SQL Interface Improvements
In Oracle 12c, you can run SQL commands in RMAN without preceding the command with the SQL keyword.
You also no longer need to enclose the SQL command in quotes.
The RMAN DESCRIBE provides the same functionality of SQL*Plus DESCRIBE:
You can run DDL/DML Commands from RMAN Command prompt, but note that in order to insert you need to use.
The user can SHUTDOWN/STARTUP the database and also can use ALTER commands.
With this new SQL Interface improvement‘s, users don‘t need to switch between RMAN and SQL*
Plus prompts during Backup & Recovery, administration…etc.
Connecting User called ATGCORE using RMAN Target.
1 2 3 4 5 6 7 |
[oracle@dba20 ~]$ rman target ATGCORE/atgcore Recovery Manager: Release 12.1.0.2.0 - Production on Fri Aug 10 18:26:49 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: ORD (DBID=1850144130) |
Execute some of SQL statements in RMAN Prompt.
1 2 3 4 5 6 7 8 9 10 11 |
RMAN> select name from v$datafile; NAME ------------------------------------ /u01/oradata/ord/system.dbf /u01/oradata/ord/sysaux.dbf /u01/oradata/ord/undotbs.dbf /u01/oradata/ord/userdata.dbf RMAN> select sysdate from dual; SYSDATE --------------- 09-AUG-18 |
Create a object under ATGCORE user but issuing commands on RMAN Prompt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
RMAN> create table emp(eid number(5), ename varchar2(10)) tablespace users; using target database control file instead of recovery catalog Statement processed RMAN> insert into emp (eid,ename) values(10,'AJAY'); Statement processed RMAN> insert into emp (eid,ename) values(20,'KUMAR'); Statement processed RMAN> commit; Statement processed RMAN> select * from exam; EID ENAME ---------- ---------- 10 AJAY 20 KUMAR |
The RMAN DESCRIBE provides the same functionality of SQL*Plus DESCRIBE:
1 2 3 4 5 6 |
RMAN> desc emp Name Null? Type ------------------ ---------------------------- EID NUMBER ENAME VARCHAR2(10) |
2. Sysbackup Privilege
Prior to 12c, users needed SYSDBA privilege to backup the database. The new Sysbackup privilege allows the user the permissions 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 same authentication options that are available with SQL*Plus, which are operating system authentication and password file authentication.
To connect to RMAN using OS Authentication, Authentication with the Sysbackup
1 2 3 4 5 6 |
[oracle@dba20 ~]$ rman target '" / as sysbackup"' Recovery Manager: Release 12.1.0.2.0 - Production on Fri Aug 10 18:48:38 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: ORD (DBID=1850144130) RMAN> exit Recovery Manager complete. |
Authentication with the SYSDBA privilege use:
1 2 3 4 5 6 |
oracle@dba20 ~]$ rman target '" / as sysdba"' Recovery Manager: Release 12.1.0.2.0 - Production on Fri Aug 10 18:49:23 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: ORD (DBID=1850144130) RMAN> exit Recovery Manager complete. |
You can also implicitly connect using below command:
1 2 3 4 5 |
[oracle@dba20 ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Fri Aug 10 18:49:36 2018 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: ORD (DBID=1850144130) RMAN> exit |
3. Recover a single Table
Oracle 12c is now providing a packaged technique which recovers only the necessary tables so as to get the data dictionary and any undo/redo segments necessary to get all the data back to a specific point in time whether that be a SCN or a timestamp.
Special Note: The default size of the SGA is 1G. It is a hard-coded parameter as it is not dependent on the existing database SGA size.
The file recover.bsq file in
$ORACLE_HOME/rdbms/admin/ contain the functions used to size the SGA .
Steps involved to bring back the table T1 into database using RMAN:
step 1 : A Full Database backup already exists
Step 2 :The dropped table is ―T1‖
Step 3 :The owner of the table is ―TEST‖
Step 4 :Recovery is done as user ―SYSBACKUP‖
Step 5 :Auxiliary Destination used is ―AUX‖
Step 6 :Table is restored as ―T1_PREV‖ to check the contents of dropped table
Directory ―TSPITR_DIROBJ_DPDIR‖ is automatically created by RMAN
Step 7 : Creates a export dumpfile tspitr_<name>.dmp
Step 8 : Imports the table as T1_PREV into the database
Step 9 : Deletes all auxiliary destination files used for the recovery.
SQL> select current_scn from v$database;
CURRENT_SCN
—————————
1423211 —-
This is the time the table TEST.T1 is dropped from the database.
1 |
[oracle@dba20 ~]$rman target ' "/ as sysbackup" ' |
Run The script in RMAN Prompt.
1 2 3 4 5 6 7 |
RMAN> run { Allocate auxiliary channel ch1 device type disk format „%U.BKP‟; RECOVER TABLE 'TEST'.'T1' until scn 1423211 AUXILIARY DESTINATION '/disk1/oradata/cdb/aux' REMAP TABLE 'TEST'.'T1':'T1_PREV'; } |
Thank you for giving your valuable time to read the above information. Please click here to subscribe for further updates
KTEXPERTS is always active on below social media platforms.
Facebook : https://www.facebook.com/ktexperts/
LinkedIn : https://www.linkedin.com/company/ktexperts/
Twitter : https://twitter.com/ktexpertsadmin
YouTube : https://www.youtube.com/c/ktexperts
Instagram : https://www.instagram.com/knowledgesharingplatform