Entering content frameProcess documentation Disaster Recovery Locate the document in its SAP Library structure

Purpose

If you lose your entire Oracle database system (possibly including hardware), and have not taken any special security precautions – such as setting up an Oracle standby database – then you have to recover the system as much as possible, step by step. This section describes how to re-install the system, and how to keep data loss to a minimum by using BRRESTORE.

Prerequisites

The following information is helpful to understand this section:

UNIX

Windows

Environment variables

$ORACLE_HOME
$SAPDATA_HOME

%ORACLE_HOME%
%SAPDATA_HOME%

Oracle Server Manager

Oracle SQLPLUS

Oracle 8.1: svrmgrl

Oracle 9.0: sqlplus

Oracle 8.1: SVRMGRL

Oracle 9.0: SQLPLUS

Profile file directory

$ORACLE_HOME/dbs

%ORACLE_HOME%\database

The default values for these variables are as follows:

UNIX

Windows

Oracle 8.1 and 9.0

$ORACLE_HOME = /oracle/<SID>/<DB_VERS>

%ORACLE_HOME% = <x>:\orant

 

$SAPDATA_HOME = /oracle/<SID>

%SAPDATA_HOME% = <y>:\oracle\<SID>

 

Caution

Windows: If the SAPARCH, SAPBACKUP, or SAPREORG directories are not located under %SAPDATA_HOME%, use the corresponding environment variables %SAPARCH%, %SAPBACKUP% or %SAPREORG%.

Process Flow

  1. You recover the hardware environment and operating system.
  2. Install the same operating system that you had before the loss.

    Recreate 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 documentation, which you can find at http://service.sap.com/instguides. Keep the reserved memory for superuser (root) to a minimum, as recommended in the installation guide.

  3. You install the database and SAP System software.
  4. The installation of the SAP software includes the software installation of the database. The initial SAP database should be completely new. However, do not load any data into the empty SAP tables. Alternatively, restore a full backup of your operating system or use the SAP installation CD.

  5. You create the file systems.
  6. 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.

  7. You adapt the initialization profile init<DBSID>.sap.

At least one valid init<DBSID>.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).

Also note the following points:

cd $ORACLE_HOME/dbs
brrestore -n init_sap

Alternatively the init<DBSID>.sap file can also be read as a third file from a BRBACKUP tape using the cpio operating system command.

This graphic is explained in the accompanying text

UNIX:

cd $ORACLE_HOME/dbs

mt -f /dev/… rewind

mt -f fsf 2

cpio -ivuB < /dev/…

Windows:

cd %ORACLE_HOME%\database

mt -f /dev/… rewind

mt -f /dev/… fsf 2

cpio -ivuB -I /dev/…

Caution

If you have configured a different block size in the init<DBSID>.sap parameter cpio_flags, you must use this same block size when restoring.

  1. You restore other profile and log files.
    1. Restore the files from the last BRBACKUP database backup, listed below.

Do this as follows:

cd $ORACLE_HOME/dbs

brrestore -n init_ora

(this includes both profiles)

Do this as follows:

cd $SAPDATA_HOME/sapreorg

brrestore -n reorg_log

(this includes both logs)

Do this as follows:

cd $SAPDATA_HOME/sapbackup

brrestore -n sum_log

Note

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.

Do this as follows:

brrestore -n det_log

Caution

From SAP Release 4.5B, you can quickly restore all logs from the BRBACKUP tape into the current directory using a single BRRESTORE command:

brrestore –n all_log

Then copy the individual logs into the correct directories.

    1. 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.
    2. 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.
    3. Restore the following file from the BRARCHIVE tape:
    4. BRARCHIVE summary log: $SAPDATA_HOME/saparch/arch<DBSID>.log

      Do this as follows:

      cd $SAPDATA_HOME/saparch

      brrestore -n sum_log

    5. Remove the BRARCHIVE tape from the tape unit and replace it with the BRBACKUP tape.
    6. If you use the BACKINT interface the procedure differs in some respects:

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

    7. Then restore the following files individually:

$SAPDATA_HOME/sapbackup/back<DBSID>.log

Do this as follows:

cd $SAPDATA_HOME/sapbackup

brrestore -d util_file -b2 "#NULL" -m $SAPDATA_HOME/sapbackup/back<DBSID>.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.

$SAPDATA_HOME/sapbackup/<coded timestamp>.<fid>

Do this as follows:

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

Do this as follows:

brrestore -d util_file -b2 "#NULL" -m <pathname>

where <pathname> is to be replaced by:

$ORACLE_HOME/dbs/init<DBSID>.ora
$ORACLE_HOME/dbs/init<DBSID>.sap
$ORACLE_HOME/dbs/init<DBSID>.dba
$ORACLE_HOME/dbs/init<DBSID>.utl
$SAPDATA_HOME/saparch/arch<DBSID>.log
$SAPDATA_HOME/sapreorg/struct<DBSID>.log
$SAPDATA_HOME/sapreorg/reorg<DBSID>.log

Note

The procedure described above is complex. You can use the restore function of the external tool as an alternative.

  1. You reset the database to the last online or offline backup.

Note

An online backup must always be recovered to a point in time after the backup.
If you require a more current status than that of the restored offline backup you can also perform a recovery.

Restore the backup completely:

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

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

Caution

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

  1. For a recovery you perform the following steps:
    1. Remove the BRBACKUP tape from the tape unit and replace it with the BRARCHIVE tape.
    2. Restore the required offline redo log files:
    3. 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<DBSID>.log).

    4. Perform database recovery with the Oracle SQLPLUS:

SQLPLUS> connect / as sysdba
SQLPLUS> startup database
SQLPLUS> recover database using backup controlfile until cancel
SQLPLUS> alter database open resetlogs;

Leaving content frame