Restore archivelog to a different location

Information on Oracle-preferred method for efficiently backing up and recovering an Oracle Database which is RMAN
Post Reply
User avatar
jimb
Site Admin
Posts: 6146
Joined: Thu Jan 19, 2012 1:10 pm
Location: New Delhi, India
Contact:

Restore archivelog to a different location

Post by jimb »

In some scenarios we may need to restore the archivelogs to a different location from its primary location using RMAN from its backups.

Connect to target database.
rman target /

Connect to catalog database.
RMAN> connect catalog rman/rman@rcat
RMAN> connect catalog rman/rman@rcat

connected to recovery catalog database
Restore by sequence:
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;
}
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
-OR-
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')" ;
Oracle Database Administration Forums
http://www.oracle-forums.com/
xaeresis
Posts: 196117
Joined: Wed Oct 04, 2023 2:39 pm

Re: Restore archivelog to a different location

Post by xaeresis »

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт
Post Reply