Finishing an Incomplete Recovery

Use

This section describes the measures that you should perform after an incomplete recovery in the following cases:

?      Case 1

Restore of a complete offline backup and subsequently opening the database, without performing a complete recovery of the database

?      Case 2

Restore of a complete online or offline backup and subsequent point-in-time recovery of the database (with ALTER DATABASE OPEN RESETLOGS)

Prerequisites

There are the following possible problem situations:

·        Situation A

The information about the last backups and volumes used in database tables SDBAH and SDBAD has been lost, because neither item is current in the database.  As a result, during the next backup, BRBACKUP prompts you to mount volumes (based on the automatic volume management) that are logically free, but are physically locked.

·        Situation B

The current log sequence number was reset during a incomplete recovery.

0       To a smaller value in case 1

0       To the value 1 in case 2

BRARCHIVE does not find the newly written offline redo log files after the restore, because offline redo logs with these log sequence numbers have already been saved.  The summary BRARCHIVE log arch<DBSID>.log still contains entries for successful backup runs of these offline redo log files and, as a result, BRARCHIVE does not detect the new offline redo log files as files requiring backup.

Procedure

Depending on the situation and case, proceed as follows:

·        Situation A

Using the detail BRBACKUP log, you can find out which volume was the last one used.  Based on the information on the volume pool in initialization profile init<DBSID>.sap (parameter backup_volumes), you can determine which volume should be used for the next backup.  Explicitly name this volume when you start the next backup:

brbackup -v <volume name1>[,<volume name2>,...]

·        Situation B

Make sure the old offline redo log files in the backup directory are renamed.

·        Case 1

The current log sequence number can be seen in the detail BRBACKUP log of the backup you used to restore the data.  Find the line Current log sequence (message BR0116I).  Then change the log sequence number in the last line of the summary BRARCHIVE log arch<DBSID>.log, which starts with #ARCHIVE, to the value: <(determined current log sequence number) - 1>.

Example: entry before:

#ARCHIVE. 86 /oracle/C11/saparch/C11arch_86 1995-04-18 15.55.55

Current log sequence number determined: 30

Entry must be changed to:

#ARCHIVE. 29 /oracle/C11/saparch/C11arch_86 1995-04-18 15.55.55

After the backup, reset the changes in this line. Note that new lines have been added.

?      Case 2

Change the log sequence number in the last line of the summary BRARCHIVE log arch<DBSID>.log, which starts with #ARCHIVE, to zero (0).

Example: entry before:

#ARCHIVE. 86 /oracle/C11/saparch/C11arch_86 1995-04-18 15.55.55

Entry must be changed to:

#ARCHIVE. 0 /oracle/C11/saparch/C11arch_86  1995-04-18 15.55.55

After the backup, reset the changes in this line. Note that new lines have been added.

BRARCHIVE automatically recognizes the resetting of log sequence numbers if the database is opened when BRARCHIVE is started. In this case, the actions described in situation B are not necessary.   

In general (as after all recovery operations), delete from the disk offline redo log files that were restored from tape to disk after the recovery. This action is automatically done by BRRECOVER if you used it for recovery.