Recovering archived log files
If you simply apply the archive after recovering the data file, you do not need to manually restore the archive file, and Rman automatically recovers the appropriate archive when recover.
Recovering an archive separately is typically a special requirement, such as creating a data guard environment. Some archived files are missing from the standby side and need to be retrieved from the primary side.
1. Recover all archived log files
Rman> RESTORE ARCHIVELOG All;
2. Recover archived files with archive numbers from 20 to 30
rman> restoer ARCHIVELOG SEQUENCE between and 30;
By default, Rman restores the archive log to the path specified by the initialization parameter log_archive_dest_1, and if it needs to be restored to a different path, set the new path to the archive through the set ARCHIVELOG DESTINATION to command, such as:
RMAN> run{SETto'F:\ORACLE\BACKUP\ARCLOG'; RESTORE between - and - ;}
3. Multiple set Archivelog commands are allowed in the same run module, which means that different archive paths can be set in different locations to restore the archive to a different directory , such as:
RMAN>run{SETARCHIVELOG DESTINATION to 'F:\ORACLE\BACKUP\ARCLOG1';RESTOREARCHIVELOG SEQUENCEbetween - and -;SETARCHIVELOG DESTINATION to 'F:\ORACLE\BACKUP\ARCLOG2';RESTOREARCHIVELOG SEQUENCEbetween to and +;SETARCHIVELOG DESTINATION to 'F:\ORACLE\BACKUP\ARCLOG3';RESTOREARCHIVELOG SEQUENCEbetween A and -;}
Recovery archive log file for Rman database recovery