Sunday, June 03, 2012

Restoring Archive Logs to a Different Location


In situations where the archived redo logs need to  be restored to a different location, from an existing backup, following steps could be followed.

1.Load the profile of the the database whose archivelog needs to be restored.
2.Connect to rman client.
@:oracle:/home/oracle> rman

Recovery Manager: Release 11.2.0.1.0 - Production on Thu May 31 10:05:37 2012

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

3.Connect to target database.

RMAN> connect target /

connected to target database: PROD (DBID=3162812738)

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

connected to recovery catalog database

5.Execute the below scripts to restore archivelogs from sequence 100278 to 100298 at location  '/stage'
RMAN>run
>{
>set archivelog destination to '/stage';
>restore archivelog from logseq 100278 until logseq 100298;
>}

executing command: SET ARCHIVELOG DESTINATION

Starting restore at 31-MAY-12
configuration for SBT_TAPE channel 2 is ignored
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=1556 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.2.0
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=16 device type=DISK

channel ORA_SBT_TAPE_1: starting archived log restore to user-specified destination
archived log destination=/home/oracle
channel ORA_SBT_TAPE_1: restoring archived log
archived log thread=1 sequence=98529
channel ORA_SBT_TAPE_1: reading from backup piece arch_784714064_61569_1
channel ORA_SBT_TAPE_1: piece handle=arch_784714064_61569_1 tag=TAG20120531T080713
channel ORA_SBT_TAPE_1: restored backup piece 1
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:02:15
Finished restore at 31-MAY-12

RMAN>

6.Restore activity completed.