RMAN is the most useful tool for Oracle in DBA’s life. Today’s post is about “RMAN Time Based Recovery”. Let’s have look on the steps.
First, take the full backup.
RMAN> run { allocate channel c1 device type disk; allocate channel c2 device type disk; backup database and archivelog all delete input; }
Create a table
SQL> create tableb01(name varchar(100)); Table created. SQL> insert intob01 values(‘Test’); 1 row created. SQL> select to_char(sysdate,’YYYY-MM-DD hh24:mi:ss’) from dual; TO_CHAR(SYSDATE,’YY ——————————– 2018-05-24 11:57:43
Now drop the table
SQL> drop tableb01; Table dropped.
start the database in mount state
SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount; ORACLE instance started. Total System Global Area 167772160b01ytes Fixed Size 1247876b01ytes Variable Size 79693180b01ytes Databaseb01uffers 79691776b01ytes Redob01uffers 7139328b01ytes Database mounted.
set the NLS parameter and run the RMAN
D:\>set nls_date_format=YYYY-MM-DD hh24:mi:ss D:\>set oracle_sid=dba20 D:\>rman RMAN> connect target sys/sys connected to target database: ORCL (DBID=847839442, not open) RMAN> run { allocate channel c1 type disk; allocate channel c2 type disk; allocate channel c3 type disk; set until time=’2018-05-24 11:57:43′; restore database; recover database; }
open the database with resetlogs
SQL> alter database open resetlogs; Database altered. SQL> select * fromb01; NAME ——————————————– TEST
Today’s thought
“See things in the present, even if they are in the future. ” Larry Ellison
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp