Entering content frameFunction documentation Partial Restore and Complete Recovery Locate the document in its SAP Library structure

Use

This section tells you about restoring damaged or lost data files after a failure in your Oracle database, and then recovering the database to the time of failure. You normally do this after a media error, such as a disk crash. With this function you can:

  1. Restore lost data files by using appropriate backups
  2. Recover the restored data file to the time of failure using the redo log files

This function consists of a number of phases that are executed either manually or automatically by SAPDBA, in a predetermined sequence.

Integration

This function performs a complete recovery to the time of failure. If you want to perform a point-in-time recovery – that is, a recovery to some time other than the time of failure – see Full Restore and Point-In-Time Recovery.

Prerequisites

To finish a partial restore and complete recovery, you must have the files shown in the following table, either as originals or backups. The table shows what you must do if the files are not available:

Missing File Type

Solution if Unavailable

Database files

Use the most recent database backup available. You must always start by restoring a backup.

Offline redo log files

Recover to the most recent available redo log file. If none available, perform a database reset from an offline backup or an online consistent backup.

init<SID>.dba and init<SID>.ora

Restore from tape.

Control files

Copy one of the control file mirrors

BRBACKUP logs and BRARCHIVE logs

Restore from last backup.

For more information if you have lost particular files, see Restoring Individual Files.

Features

The following graphic shows how a partial restore and complete recovery with SAPDBA works:

This graphic is explained in the accompanying text

Activities

  1. In the Check Database phase, SAPDBA checks the status of all files in the database (that is, the control files, online redo log files, and data files) as well as the tablespace status (online/offline; online backup mode). SAPDBA does the following:
    1. SAPDBA refers to entries in Oracle's V$Views, such as V$DATAFILE, V$RECOVER_FILE. If an error is detected during this phase, a safe check must be performed. That is, the database must be shut down, using shutdown immediate. If this is unsuccessful, SAPDBA suggests shutdown abort.
    2. To update the V$Views, SAPDBA sets the database to mount status. SAPDBA logs any recorded errors in data files in the sapreorg directory with the rcv suffix (for recovery.) A safe check is a prerequisite for any subsequent restore and recovery activities.
    3. SAPDBA does not create missing sapdata directories automatically. However, SAPDBA automatically creates missing subdirectories.
  1. In the Find Backup Files phase, SAPDBA determines the required backups using the entries in the BRBACKUP summary log file back<SID>.log (return code 0 or 1). The associated detail logs show whether the required data files were in the backup. The data files can be compiled from various backups. To minimize the subsequent recovery time, SAPDBA always suggests the most recent backup.
  2. In the Restore Backup Files phase, SAPDBA calls BRRESTOE to restore the data files to their original location. If only index files are missing, SAPDBA can recreate and build up these files using Database Dictionary information.
  3. In the Find Offline Redo Log Files phase, SAPDBA determines the offline redo log files required for a complete recovery. The BRARCHIVE summary log file arch<SID>.log lists the tapes where the offline redo log files have been saved. You can choose between a first or second backup (for example, when saved, with brarchive -cds). SAPDBA takes existing online redo log files and offline redo log files in saparch into consideration. The Find Archive phase ends when the appropriate backups have been found for all required offline redo log files.
  4. In the Restore Offline Redo Log Files phase, SAPDBA calls BRRESTORE to read the offline redo log files that have been found from tape back to the saparch directory.
  5. In the Recover Database phase, SAPDBA creates recovery scripts in a subdirectory of sapreorg. Using these scripts, SAPDBA saves a control file, and sends a recover database statement (that is, a complete recovery) to the database. The SAPDBA message Recover database terminated successfully indicates that the database has been recovered completely.
Leaving content frame