You are on page 1of 6

RMAN POINT-IN-TIME RECOVERY

Test Scenario: Host: Database:


Time to Recover: Start Time: End Time:

OSCPHLYDB01 INTPHLY
April 09, 2013 09:00:00 Wed Apr 10 09:41:48 2013 Wed Apr 10 09:59:40 EDT 2013

Steps:
1. Create a dummy table for testing. [oracle@oscphlydb02 tue]$ sqlplus dbauser@intphly SQL*Plus: Release 11.2.0.2.0 Production on Wed Apr 10 09:40:00 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Release 11.2.0.2.0 - 64bit Production SQL> create table test1 (id integer, Name, varchar2(30)); SQL> insert into test1 2 (id, name) values(2,'Testing'); 1 row created. SQL> commit; Commit complete. SQL> select * from test1 2 ; ID NAME

---------- -----------------------------2 Testing 2. Prepare point-in-time recovery script. run { allocate channel rchl1 type disk; set until time "to_date('2013-04-10:09:00:00', 'yyyy-mmdd:hh24:mi:ss')"; restore database; recover database; } 3. 4. Make sure all the Apps are down before starting the RMAN recovery. Shutdown the database. SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit 5. Connect to RMAN catalog. [oracle@oscphlydb02 tue]$ rman target=/ catalog=rman/p4ssw0rd@rmandb Recovery Manager: Release 11.2.0.2.0 - Production on Wed Apr 10 09:41:48 2013 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. connected to target database (not started) connected to recovery catalog database 6. Mount the database. RMAN> startup mount; Oracle instance started database mounted Total System Global Area 1653518336 bytes

Fixed Size Variable Size Database Buffers Redo Buffers 7.

2227032 bytes 1258292392 bytes 385875968 bytes 7122944 bytes

Execute the RMAN Point-In-Time recovery. RMAN> run { allocate channel rchl1 type disk; set until time "to_date('2013-04-10:09:00:00', 'yyyy-mm-dd:hh24:mi:ss')"; restore database; recover database; } 2> 3> 4> 5> 6> 7> allocated channel: rchl1 channel rchl1: SID=245 device type=DISK executing command: SET until clause Starting restore at 10-APR-13 channel rchl1: starting datafile backup set restore channel rchl1: specifying datafile(s) to restore from backup set channel rchl1: restoring datafile 00006 to /oracle/oradata/INTPHLY/datamart_indx.dbf channel rchl1: restoring datafile 00008 to /oracle/oradata/INTPHLY/log.dbf channel rchl1: restoring datafile 00015 to /oracle/oradata/INTPHLY/ostools_data.dbf channel rchl1: reading from backup piece /oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6oo6ltu4_s216_p1_t8123166 12 channel rchl1: piece handle=/oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6oo6ltu4_s216_p1_t 812316612 tag=DB_FULL_20130409_193002 channel rchl1: restored backup piece 1 channel rchl1: restore complete, elapsed time: 00:04:56 channel rchl1: starting datafile backup set restore channel rchl1: specifying datafile(s) to restore from backup set channel rchl1: restoring datafile 00005 to /oracle/oradata/INTPHLY/datamart_data.dbf channel rchl1: restoring datafile 00007 to /oracle/oradata/INTPHLY/lob_data.dbf channel rchl1: restoring datafile 00013 to /oracle/oradata/INTPHLY/storage_data.dbf channel rchl1: restoring datafile 00014 to /oracle/oradata/INTPHLY/storage_indx.dbf channel rchl1: reading from backup piece

/oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6po6lu72_s217_p1_t812316 898 channel rchl1: piece handle=/oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6po6lu72_s217_p1_t 812316898 tag=DB_FULL_20130409_193002 channel rchl1: restored backup piece 1 channel rchl1: restore complete, elapsed time: 00:05:05 channel rchl1: starting datafile backup set restore channel rchl1: specifying datafile(s) to restore from backup set channel rchl1: restoring datafile 00002 to /oracle/oradata/INTPHLY/sysaux01.dbf channel rchl1: restoring datafile 00003 to /oracle/oradata/INTPHLY/undotbs01.dbf channel rchl1: restoring datafile 00009 to /oracle/oradata/INTPHLY/md_indx.dbf channel rchl1: restoring datafile 00011 to /oracle/oradata/INTPHLY/object_data.dbf channel rchl1: reading from backup piece /oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6qo6lugt_s218_p1_t8123172 13 channel rchl1: piece handle=/oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6qo6lugt_s218_p1_t 812317213 tag=DB_FULL_20130409_193002 channel rchl1: restored backup piece 1 channel rchl1: restore complete, elapsed time: 00:03:15 channel rchl1: starting datafile backup set restore channel rchl1: specifying datafile(s) to restore from backup set channel rchl1: restoring datafile 00001 to /oracle/oradata/INTPHLY/system01.dbf channel rchl1: restoring datafile 00004 to /oracle/oradata/INTPHLY/users01.dbf channel rchl1: restoring datafile 00010 to /oracle/oradata/INTPHLY/meta_data.dbf channel rchl1: restoring datafile 00012 to /oracle/oradata/INTPHLY/object_indx.dbf channel rchl1: reading from backup piece /oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6ro6lunv_s219_p1_t8123174 39 channel rchl1: piece handle=/oracle/backup/INTPHLY/rmanbackup/tue/bk_df_u6ro6lunv_s219_p1_t 812317439 tag=DB_FULL_20130409_193002 channel rchl1: restored backup piece 1 channel rchl1: restore complete, elapsed time: 00:02:56 Finished restore at 10-APR-13 Starting recover at 10-APR-13 starting media recovery media recovery complete, elapsed time: 00:00:53

Finished recover at 10-APR-13 released channel: rchl1 RMAN> exit Recovery Manager complete. 8. Open the database in resetlog mode. [oracle@oscphlydb02 tue]$ sqlplus '/as sysdba' SQL*Plus: Release 11.2.0.2.0 Production on Wed Apr 10 10:09:50 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Release 11.2.0.2.0 - 64bit Production SQL> alter database open resetlogs; Database altered. SQL> exit Disconnected from Oracle Database 11g Release 11.2.0.2.0 - 64bit Production 9. Verify if the dummy test1 table exists. [oracle@oscphlydb02 tue]$ sqlplus dbauser@intphly SQL*Plus: Release 11.2.0.2.0 Production on Wed Apr 10 10:11:00 2013 Copyright (c) 1982, 2010, Oracle. All rights reserved. Enter password: Connected to: Oracle Database 11g Release 11.2.0.2.0 - 64bit Production SQL> desc test1 ERROR: ORA-04043: object test1 does not exist

10.

Test completed successfully.

You might also like