Complete Database Recovery

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 BRRECOVER in a predetermined sequence.

This section discusses how to approach complete database recovery.

For more information on how to perform a complete database recovery, see Complete Database Recovery with BR*Tools.

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:

·        Database point-in-time recovery

·        Tablespace point-in-time recovery

Prerequisites

To finish 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

init<DBSID>.dba and init<DBSID>.ora

Restore from backup as described in Disaster Recovery.

BRBACKUP Logs and BRARCHIVE Logs

Restore from backup as described in Disaster Recovery.

Control files

Copy one of the control file mirrors if available. Otherwise, use one of the following:

·        Database point-in-time recovery

·        Whole database reset

Online redo log files

Copy one of the redo log file mirrors if available.

If the non-current redo log group is involved, use ALTER DATABASE to drop and recreate the group.

If the current group is involved, use one of the following:

·        Database  point-in-time recovery

·        Whole database reset

Database files

These files are automatically restored and recovered during complete database recovery.

Offline redo log files

Perform database point-in-time recovery to the most recent available redo log file. If none is available, perform a whole database reset from an offline backup or an online consistent backup.

Features

The following graphic shows how a complete recovery works:

Activities

...

       1.      Check the Status of Database Files phase

BRRECOVER checks the status of all files in the database (that is, the control files, online redo log files, and data files). BRRECOVER does the following:

...

                            a.      To update the v$ views, BRRECOVER stops the database instance if started and sets the database to mount status. BRRECOVER logs any recorded errors in data files to the detail log created in the sapbackup directory with the crv suffix (for complete recovery.)

                            b.      BRRECOVER refers to entries in Oracle's v$ views, such as v$datafile, v$recover_file to determine the status of database files.

                            c.      BRRECOVER does not create missing sapdata directories automatically, so they must exist beforehand. However, BRRESTORE automatically creates missing subdirectories under sapdata directories during the Restore Data Files phase.

       2.      Select Database Backup phase

BRRECOVER determines the eligible backups using the entries in the BRBACKUP summary log file back<DBSID>.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, BRRECOVER always suggests the most recent backup.

BRRECOVER also roughly checks the availability of offline redo log files.

You can also select an incremental backup to be restored before applying offline redo log files. In this case, BRRECOVER automatically selects the corresponding full backup to restore missing files.

       3.      Restore Data Files phase

BRRECOVER calls BRRESTORE to restore the data files to their original location.

       4.      Apply Incremental Backup phase

If you selected an incremental backup during the Select Database Backups phase, BRRECOVER calls BRRESTORE to restore and apply the selected incremental backup.

       5.      Determine Offline Redo Log Files Needed phase

BRRECOVER determines the offline redo log files required for a complete recovery. The BRARCHIVE summary log file arch<DBSID>.log lists the backups of the offline redo log files. BRRECOVER takes existing online redo log files and offline redo log files in saparch or oraarch into consideration.

       6.      Restore Offline Redo Log Files phase

BRRECOVER calls BRRESTORE to restore the offline redo log files that have been found back to the saparch or oraarch directory.

       7.      Apply Offline Redo Log Files phase

BRRECOVER calls SQLPLUS to apply offline redo log files to the database.

Offline redo log files are applied to the database in groups of at most 100 files. If you have more than 100 files to apply, the restore and apply phases are repeated as necessary.

The restore and apply phases can be executed in parallel to minimize total recovery time.

       8.      Open Database phase

During this phase BRRECOVER:

...

                            a.      Opens the database

                            b.      Checks the status of database files and tablespaces