

If a datafile at the duplicate is in the correct place with the correct header contents, then the datafile is not duplicated. Restore optimization is also used when duplicating a database. If you run the same RESTORE operation again, then RMAN only restores the single datafile that was not restored during the previous attempt.
ORACLE 10G RMAN RESTORE FULL
For example, assume that a full database restore encounters a power failure after all except one of the datafiles has been restored. Restore optimization is particularly useful in cases where an operation that restores several datafiles is interrupted. You can use the FORCE option of the RESTORE command to override this behavior and restore the requested files unconditionally. It does not the scan the datafile body for corrupted blocks.

Restore optimization only checks the datafile header. ORA-19505: failed to identify file "/u01/backup/db_1" ORA-19624: operation failed, retry possible When restore failover cannot locate another copy of the same backup and searches for a prior backup, the message generated is similar to this example: When RMAN performs restore failover to another backup of the same file, you will see a message similar to this one in the output of RMAN:įailover to piece handle=/u01/backup/db_1 tag=BACKUP_031009Īlso, details about block corruptions will be printed in the alert log and trace files. Restore failover is also used when there are errors restoring archivelogs during RECOVER, BLOCKRECOVER, and FLASHBACK DATABASE commands. If all of the backups are unusable or no backups exists, then RMAN will try to re-create the datafile.

RMAN searches all prior backups for the most recent available backup usable in the current operation until it has exhausted all possibilities. If no usable copies are available, then RMAN searches for prior backups. Configuring automatic channels makes it more likely that RMAN can find and restore a backup that satisfies the specified criteria.ĭuring a RESTORE operation, if a backup piece, image copy or proxy copy is inaccessible (for instance, deleted from the device) or a block in the backup is corrupted, then RMAN automatically looks for a another usable copy of this backup piece or image copy, on the same device or another device, based on the information in the RMAN repository. If you use only manually allocated channels, a backup job may fail if there is no usable backup on the media for which you allocated channels. If no available backup in the repository satisfies all the specified criteria, then RMAN returns an error during the compilation phase of the restore job. Unless limited by the DEVICE TYPE clause, the RESTORE command searches for backups on all device types of configured channels. If two backups are from the same point in time, RMAN prefers to use image copies over backup sets because RMAN can restore more quickly from image copies than from backup sets (especially those stored on tape).Īll specifications of the RESTORE command must be satisfied before RMAN restores a backup. The most recent backup available, or the most recent backup satisfying any UNTIL clause specified in the RESTORE command, is always the preferred choice. RMAN uses the record of available backups in the RMAN repository to select the best available backups for use in the restore operation. How RMAN Selects Backups for Use in Restore Operations The SWITCH command is the RMAN equivalent of the SQL statement ALTER DATABASE RENAME FILE. SWITCH DATAFILE '/tmp/tools01.dbf' TO DATAFILECOPY '?/oradata/trgt/tools01.dbf'
ORACLE 10G RMAN RESTORE UPDATE
To update the control file to use the datafile copy at ?/oradata/trgt/tools01.dbf to /tmp/tools01.dbf as the datafile, use the SWITCH command as shown in the following example: In this case, RMAN creates a datafile copy of ?/oradata/trgt/tools01.dbf named /tmp/tools01.dbf and records it in the repository. RESTORE DATAFILE '?/oradata/trgt/tools01.dbf' SET NEWNAME FOR DATAFILE '?/oradata/trgt/tools01.dbf' TO '/tmp/tools01.dbf'

For example, assume that you run the following commands: If you run a SET NEWNAME command before you restore a file, then RMAN creates a datafile copy with the name that you specify. If no, then RMAN doesn't update current datafile names and the restored file is retained as datafile copies.įor example, if you restore datafile ?/oradata/trgt/tools01.dbf to its default location, then RMAN restores the file ?/oradata/trgt/tools01.dbf and overwrites any file that it finds with the same filename. If yes, then RMAN replaces the current datafile names in the control file to the names of the restored files and current datafile names (if exists) are stored as datafile copies. RMAN restores the files to the path names specified by SET NEWNAME and creates repository records for each datafile copy after the restore. RMAN restores the files to their current path names.
