Databases Reference
In-Depth Information
Restoring to Nondefault Location
Use the set archivelog destination clause if you want to restore archived redo log files to a different location
than the default. The following example restores to the nondefault location of /u01/archrest. The set archivelog
destination command must be run from within the RMAN run{} block.
RMAN> run{
set archivelog destination to '/u01/archrest';
restore archivelog from sequence 40;
}
You may have disk space issues and need to spread the restored archived redo logs across multiple locations.
You can do so as follows:
RMAN> run{
set archivelog destination to '/u01/archrest';
restore archivelog from sequence 1 until sequence 10;
set archivelog destination to '/u02/archrest';
restore archivelog from sequence 11;
}
How It Works
To be able to restore archive redo logs, you must have good backups. Usually the archive redo logs are backed up
via a command similar to this:
RMAN> backup database plus archivelog;
or
RMAN> backup archivelog all;
You can verify which archive redo logs are in which backup sets as shown:
RMAN> list backup of archivelog all;
If you are uncertain of the sequence numbers to use during a restore of log files, you can query the
V$ARCHIVED_LOG view:
SQL> select thread#, sequence#, name from v$archived_log;
If you've enabled an FRA, then RMAN will by default restore archived redo log files to a subdirectory within
the destination defined by the initialization parameter db_recovery_file_dest . Otherwise, RMAN uses the
log_archive_dest_N (where 1 is commonly used for N) initialization parameter to determine where to restore the
archived redo log files.
If you restore archived redo log files to a nondefault location, RMAN knows the location they were restored to and
automatically finds these files when you issue any subsequent recover commands. RMAN will not restore archived
redo log files that it determines are already on disk. Even if you specify a nondefault location, RMAN will not restore
an archived redo log file to disk if it already exists. In this situation, RMAN will simply return a message stating that the
archived redo log file has already been restored. Use the force command to override this behavior:
RMAN> restore archivelog all force;
 
Search WWH ::




Custom Search