Restoring Archived Redo Logs to a New Location
You
can override the default location for restored archived redo logs with the SET ARCHIVELOG DESTINATION command. This
command manually stages archived logs to different locations while a database
restore is occurring. During recovery, RMAN knows where to find the newly
restored archived logs; it does not require them to be in the location
specified in the initialization parameter file.
To restore archived redo logs to a new location:
- Start RMAN and connect to a
target database.
- Ensure that the database is
mounted or open.
- Perform the following
operations within a RUN command:
- Specify the new location for
the restored archived redo logs using SET ARCHIVELOG DESTINATION.
- Either explicitly restore the
archived redo logs or execute commands that automatically restore the
logs.
The following sample RUN command explicitly restores all backup
archived logs to a new location:
RUN
{
SET ARCHIVELOG DESTINATION TO
'/oracle/temp_restore';
RESTORE ARCHIVELOG ALL;
# restore and recover datafiles as needed
.
.
.
}
The following example sets the archived log destination and then
uses RECOVER DATABASE to restore archived logs from this
destination automatically:
RUN
{
SET ARCHIVELOG DESTINATION TO
'/oracle/temp_restore';
RESTORE DATABASE;
RECOVER DATABASE; # restores and recovers
logs automatically
}
You
can specify restore destinations for archived logs multiple times in one RUN block, in order to distribute restored
logs among several destinations. (You cannot, however specify multiple
destinations simultaneously to produce multiple copies of the same log during
the restore operation.) You can use this feature to manage disk space used to
contain the restored logs.
This
example restores 300 archived redo logs from backup, distributing them across
the directories /fs1/tmp, /fs2/tmp, and /fs3/tmp:
RUN
{
# Set a new location for logs 1 through 100.
SET ARCHIVELOG DESTINATION TO '/fs1/tmp';
RESTORE ARCHIVELOG FROM SEQUENCE 1 UNTIL
SEQUENCE 100;
# Set a new location for logs 101 through
200.
SET ARCHIVELOG DESTINATION TO '/fs2/tmp';
RESTORE ARCHIVELOG FROM SEQUENCE 101 UNTIL
SEQUENCE 200;
# Set a new location for logs 201 through
300.
SET ARCHIVELOG DESTINATION TO '/fs3/tmp';
RESTORE ARCHIVELOG FROM SEQUENCE 201 UNTIL
SEQUENCE 300;
# restore and recover datafiles as needed
.
.
.
}


No comments