Connect to target database.
rman target /
Connect to catalog database.
RMAN> connect catalog rman/rman@rcat
Restore by sequence:RMAN> connect catalog rman/rman@rcat
connected to recovery catalog database
Execute the below scripts to restore archivelogs from sequence 39 to 40 at location '/u01/arch/'
Code: Select all
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
set archivelog destination to '/u01/arch/';
restore archivelog from logseq=39 until logseq=40;
release channel c1;
release channel c2;
}
RMAN> run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
set archivelog destination to '/u01/arch/';
restore archivelog from logseq=39 until logseq=40;
release channel c1;
release channel c2;
}2> 3> 4> 5> 6> 7> 8> 9>
starting full resync of recovery catalog
full resync complete
released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=66 device type=DISK
allocated channel: c2
channel c2: SID=63 device type=DISK
executing command: SET ARCHIVELOG DESTINATION
starting full resync of recovery catalog
full resync complete
Starting restore at 26-FEB-13
starting full resync of recovery catalog
full resync complete
channel c1: starting archived log restore to user-specified destination
archived log destination=/u01/arch/
channel c1: restoring archived log
archived log thread=1 sequence=39
channel c1: restoring archived log
archived log thread=1 sequence=40
channel c1: reading from backup piece /u01/backup/PRIM_808398835_10
channel c1: piece handle=/u01/backup/PRIM_808398835_10 tag=TAG20130226T111349
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:03
Finished restore at 26-FEB-13
starting full resync of recovery catalog
full resync complete
starting full resync of recovery catalog
full resync complete
released channel: c1
released channel: c2
Restore by time:
Execute the below scripts to restore archivelogs from 26-02-2013 up to now at location '/u01/arch/'
Code: Select all
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
set archivelog destination to '/u01/arch/';
restore archivelog FROM time "to_date('26-02-2013','DD-MM-YYYY')";
release channel c1;
release channel c2;
}
-OR-RMAN> run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
set archivelog destination to '/u01/arch/';
restore archivelog FROM time "to_date('26-02-2013','DD-MM-YYYY')";
release channel c1;
release channel c2;
}2> 3> 4> 5> 6> 7> 8> 9>
starting full resync of recovery catalog
full resync complete
released channel: ORA_DISK_1
allocated channel: c1
channel c1: SID=66 device type=DISK
allocated channel: c2
channel c2: SID=63 device type=DISK
starting full resync of recovery catalog
full resync complete
executing command: SET ARCHIVELOG DESTINATION
starting full resync of recovery catalog
full resync complete
starting full resync of recovery catalog
full resync complete
Starting restore at 26-FEB-13
starting full resync of recovery catalog
full resync complete
channel c1: starting archived log restore to user-specified destination
archived log destination=/u01/arch/
channel c1: restoring archived log
archived log thread=1 sequence=14
channel c1: restoring archived log
archived log thread=1 sequence=15
channel c1: restoring archived log
archived log thread=1 sequence=16
channel c1: restoring archived log
archived log thread=1 sequence=17
channel c1: restoring archived log
archived log thread=1 sequence=18
channel c1: restoring archived log
archived log thread=1 sequence=19
channel c1: restoring archived log
archived log thread=1 sequence=20
channel c1: restoring archived log
archived log thread=1 sequence=21
channel c1: restoring archived log
archived log thread=1 sequence=22
channel c1: restoring archived log
archived log thread=1 sequence=23
channel c1: restoring archived log
archived log thread=1 sequence=24
channel c1: restoring archived log
archived log thread=1 sequence=25
channel c1: restoring archived log
archived log thread=1 sequence=26
channel c1: restoring archived log
archived log thread=1 sequence=27
channel c1: restoring archived log
archived log thread=1 sequence=28
channel c1: restoring archived log
archived log thread=1 sequence=29
channel c1: restoring archived log
archived log thread=1 sequence=30
channel c1: restoring archived log
archived log thread=1 sequence=31
channel c1: restoring archived log
archived log thread=1 sequence=32
channel c1: restoring archived log
archived log thread=1 sequence=33
channel c1: restoring archived log
archived log thread=1 sequence=34
channel c1: restoring archived log
archived log thread=1 sequence=35
channel c1: restoring archived log
archived log thread=1 sequence=36
channel c1: reading from backup piece /u01/backup/PRIM_808386834_7
channel c2: starting archived log restore to user-specified destination
archived log destination=/u01/arch/
channel c2: restoring archived log
archived log thread=1 sequence=37
channel c2: restoring archived log
archived log thread=1 sequence=38
channel c2: reading from backup piece +FLASH/prim/backupset/2013_02_26/annnf0_tag20130226t110011_0.288.808398017
channel c2: piece handle=+FLASH/prim/backupset/2013_02_26/annnf0_tag20130226t110011_0.288.808398017 tag=TAG20130226T110011
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:08
channel c2: starting archived log restore to user-specified destination
archived log destination=/u01/arch/
channel c2: restoring archived log
archived log thread=1 sequence=39
channel c2: restoring archived log
archived log thread=1 sequence=40
channel c2: reading from backup piece /u01/backup/PRIM_808398835_10
channel c1: piece handle=/u01/backup/PRIM_808386834_7 tag=TAG20130226T075252
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:12
channel c2: piece handle=/u01/backup/PRIM_808398835_10 tag=TAG20130226T111349
channel c2: restored backup piece 1
channel c2: restore complete, elapsed time: 00:00:03
Finished restore at 26-FEB-13
starting full resync of recovery catalog
full resync complete
starting full resync of recovery catalog
full resync complete
released channel: c1
starting full resync of recovery catalog
full resync complete
starting full resync of recovery catalog
full resync complete
released channel: c2
starting full resync of recovery catalog
full resync complete
Restore to a range of time:
restore archivelog FROM time "to_date('15-02-2013','DD-MM-YYYY')" until time "to_date('19-02-2013','DD-MM-YYYY')" ;