Oracle RMAN Recovery involves two parts: restoring a physical backup and then performing recovery with the changes made to the database since the last backup. A media recovery is executed on the user's command, usually in response to media failure. In media recovery, online or archived redo logs can be used to make a restored backup current or to update it to a specific point in time.
You have to plan your database restore and recovery actions based on which database files have been lost and your recovery goal. RMAN can make most of the important decisions about the restore process for you, but you may want to preview and even override its decisions in some circumstances.
For example, if you know a given backup is unavailable, due to a tape being stored offsite or a device being inaccessible, you can direct RMAN to not use that backup during the restore process.
Database Restore and Recovery Procedure: Outline
- Determine which database files must be restored from backup, and which backups.
- Place the database in the state appropriate for the type of recovery that you are performing. For example, if you are recovering a single tablespace or datafile, then you can keep the database open and take the tablespace or datafile offline. If you are restoring all datafiles, then you must shut down the database and then mount it before you can perform the restore.
- Restore lost database files from backup with the RESTORE command.
- Perform media recovery on restored datafiles, if any, with the RECOVER command.
- Perform any final steps required to make the database available for users again. For example, re-open the database if necessary, or bring offline tablespaces online.
Preparing for Complete Database Recovery
While RMAN simplifies most database restore and recovery tasks, you must still plan your database restore and recovery strategy based on which database files have been lost and your recovery goal. This section contains the following topics:
- dentifying the Database Files to Restore or Recover
- Determining the DBID of the Database
- Previewing Backups Used in Restore Operations
- Validating Backups Before Restoring Them
- Restoring Archived Redo Logs Needed for Recovery
Media recovery can restore the whole database, a tablespace or a datafile and recover them to a specified time. Whenever redo logs are used or a database is recovered to some non-current time, media recovery is being performed.
Use the RESTORE and RECOVER commands for RMAN restore and recovery of physical database files.