Register Login

Recovery of SAP HANA Database Fails

Updated May 18, 2018

How to do the Recovery of SAP HANA Database Fails?

Entries of the following type appear in the file backup.log because a recovery of SAP HANA database fails.

ERROR   RECOVERY RECOVER DATA finished with error: [449] recovery strategy could not be determined, volume 1, reached log position 0, [111004] Ambiguous sequence of log backups, overlapping log backups: Log backup log_backup_1_0_381184_384512 found starting with redo log position 381184, but expected it to start with redo log position 381248

The failed recovery should restore the database to the most recent state or to a specific point in time.

Your unwanted log backup files must be moved in the file system, because the backup catalog must be regenerated, and the recovery must be repeated.

While Moving the unwanted log backups

You can use only a log that was generated either before the first recovery described above or that was generated after the recovery. Each unwanted log backup file must be moved.

Refer to the file backup.log for the point in time of the recovery. There the recovery command "RECOVER DATA USING FILE ('<backupprefix>') CLEAR LOG" is logged with a time stamp.

The point in time of the recovery helps you to locate the interruption of the log backup sequence.

If there were several recoveries that interrupted the log, then there are more incompatible sequences in the log accordingly. For two recoveries, there is one sequence that occurred before the first recovery; one sequence between the first and the second recovery and one sequence after the second recovery.

Alternatively, the switch of log sequences can be determined in the file system. The log backup files contain the log items in the file name and the sequence of the log items was interrupted by the recovery. The log backup files are named according to the model log_backup_<volume>_0_<pos1>_<pos2>. The files of a volume produce a sequence in which <pos2> of a file occurs as <pos1> of a successor file. If the log sequence was interrupted, this sequence is also interrupted.

The log backups are in a directory that is configured by the parameter basepath_logbackup.

Example (only log backups of the name server):

> ls -ltr log_backup_1*
-rw------- 1 r25adm sapsys 20480 2012-10-23 15:35 log_backup_1_0_381056_381248
-rw------- 1 r25adm sapsys 221184 2012-10-23 15:36 log_backup_1_0_381184_384512
-rw------- 1 r25adm sapsys 12288 2012-10-23 15:36 log_backup_1_0_384512_384576
-rw------- 1 r25adm sapsys 45056 2012-10-23 15:41 log_backup_1_0_384576_385152
-rw------- 1 r25adm sapsys 1744896 2012-10-23 16:00 log_backup_1_0_385152_412288
-rw------- 1 r25adm sapsys 376832 2012-10-23 16:17 log_backup_1_0_412288_418048

In the example, the log was interrupted at 15:36. The file log_backup_1_0_381056_381248 does not have a successor. The example shows only the log backups of the name server or of volume 1. The log backups of all services or volumes must be taken into account. The example shows only one interruption of the log.

Decide which log backup sequence you want to restore and move the unwanted files to another directory. This directory must not be a subdirectory to a directory that contains the required log backup files.

While Generating the backup catalog

As of Version SP 5, SAP HANA database uses an existing backup catalog for the recovery. If you use Version SP 5 of SAP HANA database or higher, you must regenerate the backup catalog on the basis of the required backups.

Skip this step if you use SP 4 or lower.

Use the program hdbbackupdiag to regenerate the backup catalog. Use the following options:

-d : Value of the parameter basepath_logbackup as the directory to which the backup catalog is to be saved
-c : log_backup_0_0_0_0.00 as the name for the backup catalog
--dataDir : Directory in which the required data backup is located
--logDirs : List of directories (separated by commas or spaces) in which the required log backups are located

Example:

hdbbackupdiag -d $DIR_INSTANCE/backup/log -c log_backup_0_0_0_0.00 --generate --dataDir $DIR_INSTANCE/backup/data --logDirs $DIR_INSTANCE/backup/log

While Repeating the recovery

Now repeat the recovery. If you have chosen the newest log backup sequence in step 1, you can freely select the option "initialize log area" for the recovery. Otherwise, the option must always be selected because the log area of the database is not compatible with the selected log backups sequence.


×