Disaster Recovery 

Prerequisites

If you lose your entire system (possibly including hardware), and have not made any special security precautions for such an occurrence, for example an ORACLE standby configuration, then you have to recover the system as much as possible, step by step. The following describes how to install the system again, and how to keep data loss at a minimum by using the SAP program BRRESTORE.

Note:

$ORACLE_HOME and $SAPDATA_HOME stand for the environment variables set under UNIX, %ORACLE_HOME% and %SAPDATA_HOME% are the corresponding variables under Windows NT.
Under UNIX svrmgrl stands for the ORACLE Program Server Manager, under Windows NT the name is SVRMGR30.
Under UNIX the profile files are in the directory
$ORACLE_HOME/dbs , under Windows NT they are in the directory %ORACLE_HOME%\database .

Procedure

1. Recovering the hardware environment

Install the same operating system that you had before the loss.
Create the distribution of the hard disks according to the original size and structure. Take this into account when purchasing the replacement disks.
Format the disks as described in the SAP Installation Guide.

2. Installation of the R/3 System

The installation of the SAP software includes the software installation of the database. When you do this, you must not create the initial SAP database.

3. Modifying the installation

When you do this, take special consideration of the mounted file systems at the time of the loss. If necessary, create new SAPDATA directories (mount points). These usually identify a hard disk or a logical volume.

Place the BRBACKUP backup tape of the last successful and complete backup in the tape unit.

4. Adapting the init<SID>.sap file

At least one valid init<SID>.sap file must exist before you can start BRRESTORE.

Adapt this file, for example with respect to the devices and drivers used. (See: Configuration of the BRBACKUP profile file).

In addition to this, note the following points:

BS> cd $ORACLE_HOME/dbs
BS> brrestore -n init_sap

Alternatively:

5. Restoring certain files

Restore the files of the last BRBACKUP database backup, listed below.

Method:
BS> cd $ORACLE_HOME/dbs
BS> brrestore -n init_ora

Method:
BS> cd $SAPDATA_HOME/sapreorg
BS> brrestore -n reorg_log

Method:
BS> cd $SAPDATA_HOME/sapbackup
BS> brrestore -n sum_log

The last entry in the summary log matches the last backup. This is the relevant entry for the detail log (see next step). The last entry is normally incomplete, for example: return code not current. However this does not have any consequences for any of the subsequent operations.

Method:
BS> brrestore -n det_log

Take the <coded_timestamp> and the <fid> from the name of this restored file in the restore directory. This is required for the following operations.

Remove the BRBACKUP tape from the tape unit and replace it with the BRARCHIVE tape of the last backup of the offline redo log files.

Restore the following file from the BRARCHIVE tape:

Method:
BS> cd $SAPDATA_HOME/saparch
BS> brrestore -n sum_log

Remove the BRARCHIVE tape from the tape unit and replace it with the BRBACKUP tape.

Using an external backup program

If you use the BACKINT interface the procedure differs in some respects:

The profiles init<SID>.utl (optional, depending on backup program) and init<SID>.sap must exist before you use BACKINT. In the profile init<SID>.sap you only have to define the name of the profile of the external backup program in the parameter util_par_file . You may have to reconstruct this first. You can do this either by editing, or by using the BACKINT command line interface.

Then restore the following files individually:

Method:
BS> cd $SAPDATA_HOME/sapbackup
BS> brrestore -d util_file -b2 #NULL -m $SAPDATA_HOME/sapbackup/back<SID>.log

The last entry in the summary log matches the last backup. This is the relevant entry for the detail log (see next step). The last entry is normally incomplete, for example: return code not current. However this does not have any consequences for any of the subsequent operations. Take the <coded_timestamp> and the <fid> from this entry. This is required for the following operations.

Method.
BS> brrestore -d util_file -b2 #NULL -m $SAPDATA_HOME/sapbackup/<coded timestamp>.<fid>

Take the ID of the external backup tool ( <external backup tool ID> ) from this BRBACKUP detail log.
To do this search for the character string
#INLOG in the detail log.

You can find the ‘backup tool ID’ in the line beginning with ‘ #SAVED ’, for example:

#INLOG..../oracle/C11/dbs/initC11.sap
#SAVED....<external backup tool ID>

Method:
BS> brrestore -d util_file -b2 <external backup tool ID> -m <pathname>

$ORACLE_HOME/dbs/init<SID>.ora
$ORACLE_HOME/dbs/init<SID>.sap
$ORACLE_HOME/dbs/init<SID>.dba
$ORACLE_HOME/dbs/init<SID>.utl
$SAPDATA_HOME/saparch/arch<SID>.log
$SAPDATA_HOME/saparch/<coded timestamp of BRARCHIVE>.<fid>
$SAPDATA_HOME/sapreorg/struct<SID>.log
$SAPDATA_HOME/sapreorg/reorg<SID>.log

The procedure described above is relatively complex. We recommend that you use the restore function of the external tool as an alternative.

6.) Resetting the database to the last online or offline backup.

Note: An online backup must always be recovered to a point in time before the backup.
If you require a more current status than that of the imported offline backup you can also make a recovery.

Restore the backup completely:

BS> brrestore -b <coded_timestamp>.<fid> -m full

The < coded_timestamp> and <fid> were already determined from the summary BRBACKUP log.

If you have to make another recovery you must not open the database at this point.

7.) For a recovery you need to perform the following steps:

Remove the BRBACKUP tape from the tape unit and replace it with the BRARCHIVE tape.

a) Retrieval of the required offline redo log files

BS> brrestore -a <log_seg_No_A>-<log_seg_No_B>

<Log_Seg_No_A> stands as ‘Current log sequence’ in the header of the detail BRBACKUP log.

<Log_Seg_No_B> stands as ‘target log sequence no.’ and matches the last backed up offline redo log file (last entry in the summary BRARCHIVE log arch<SID>.log ).

b) Database recovery with the ORACLE Server Manager

svrmgrl> set autorecovery off
svrmgrl> recover database using backup controlfile until cancel
svrmgrl> alter database open resetlogs

 

See also: Standby Database Scenario: