Restoring Archived Redo Log Files

When you issue a RECOVER command from RMAN, the RMAN utility first looks on disk to see if the necessary archived redo log files are present. If they aren’t, RMAN retrieves them from any RMAN archived redo log file backups that you’ve taken. If you want to explicitly tell RMAN to bring back your archived redo log files, you use the RESTORE ARCHIVELOG command.

Note

For datafile recovery, if there is an incremental backup available, RMAN uses an incremental backup over an archived redo log file.

The following Oracle9i example sets a location where the archived redo log files are written and then restores them. Even in Oracle9i, this command must be executed from within the run{} command.

RMAN> run {
2> set archivelog destination to '/d00/backup/';
3> restore archivelog all; }

If the archived redo log files aren’t on disk, or if they haven’t been backed up, you could be in trouble. Here’s an Oracle9i example showing how to restore a tablespace and then use the RECOVER command to automatically rebuild and apply the archived redo log files that are not on disk but have been backed up via RMAN:

RMAN> restore tablespace users;
RMAN> recover tablespace users;

Get Oracle RMAN Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.