Monday, May 26, 2014

RMAN Incomplete recovery using log sequence

(1) Script to perform incomplete recovery using log sequence
run
 {
 startup mount;
 set until sequence 5 thread 1;
 restore database;
 recover database parallel;
 sql "alter database open resetlogs";
 }

(2) Output of the incomplete recovery using log sequence
$ rman target="/"

Recovery Manager: Release 11.2.0.4.0 - Production on Mon May 26 06:31:13 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: CVRMAN (DBID=657566608)

RMAN> shutdown immediate;

using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down

RMAN> @rman_incomplete_recovery_log_Sequence.cmd

RMAN> run
2> {
3> startup mount;
4> set until sequence 5 thread 1;
5> restore database;
6> recover database parallel;
7> sql "alter database open resetlogs";
8> }
connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area     730714112 bytes

Fixed Size                     2256832 bytes
Variable Size                452984896 bytes
Database Buffers             272629760 bytes
Redo Buffers                   2842624 bytes

executing command: SET until clause

Starting restore at 26-MAY-2014 06:32:48
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=27 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=28 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=29 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=30 device type=DISK
flashing back control file to SCN 1534402

skipping datafile 4; already restored to file +DATA/cvrman/datafile/users.259.847354795
skipping datafile 5; already restored to file +DATA/cvrman/datafile/example_new.dbf
creating datafile file number=7 name=+DATA/cvrman/datafile/tbs2.328.848469625
channel ORA_DISK_1: restoring datafile 00006
input datafile copy RECID=83 STAMP=848217961 file name=+DATA/cvrman/datafile/tbs1.294.847433665
destination for restore of datafile 00006: +DATA/cvrman/datafile/tbs1_new.dbf
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00003 to +DATA/cvrman/datafile/undotbs1.318.848201233
channel ORA_DISK_2: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00002 to +DATA/cvrman/datafile/sysaux.257.847354793
channel ORA_DISK_3: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00001 to +DATA/cvrman/datafile/system.256.847354793
channel ORA_DISK_4: reading from backup piece +DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917
channel ORA_DISK_1: copied datafile copy of datafile 00006
output file name=+DATA/cvrman/datafile/tbs1_new.dbf RECID=0 STAMP=0
channel ORA_DISK_2: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.290.848207929 tag=TAG20140522T051830
channel ORA_DISK_2: restored backup piece 1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:25
channel ORA_DISK_3: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.287.848207921 tag=TAG20140522T051830
channel ORA_DISK_3: restored backup piece 1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:48
channel ORA_DISK_4: piece handle=+DATA/cvrman/backupset/2014_05_22/nnndf0_tag20140522t051830_0.313.848207917 tag=TAG20140522T051830
channel ORA_DISK_4: restored backup piece 1
channel ORA_DISK_4: restore complete, elapsed time: 00:01:08
Finished restore at 26-MAY-2014 06:34:12

Starting recover at 26-MAY-2014 06:34:13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
datafile 4 not processed because file is read-only
datafile 5 not processed because file is read-only

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559
archived log for thread 1 with sequence 9 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561
archived log for thread 1 with sequence 10 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559
archived log for thread 1 with sequence 1 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105
archived log for thread 1 with sequence 2 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759
archived log for thread 1 with sequence 3 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471
archived log for thread 1 with sequence 4 is already on disk as file +DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_8.319.848465559 thread=1 sequence=8
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_9.320.848465561 thread=1 sequence=9
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_10.317.848465559 thread=1 sequence=10
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_1.325.848467105 thread=1 sequence=1
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_2.301.848469759 thread=1 sequence=2
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_3.309.848480471 thread=1 sequence=3
archived log file name=+DATA/cvrman/archivelog/2014_05_25/thread_1_seq_4.280.848480485 thread=1 sequence=4
media recovery complete, elapsed time: 00:00:35
Finished recover at 26-MAY-2014 06:34:53

sql "alter database open resetlogs";

sql statement: alter database open resetlogs

RMAN> **end-of-file**



No comments: