Recovering SAP HANA Data from an Application-Free Restore

After restoring the application data and logs, you can recover the SAP HANA database from the disk using the SAP HANA Studio interface.

Before You Begin

Complete the following steps:

  1. Restore the application data and logs to a disk.

  2. Stop the database which you want to restore, and then set the Log/Catalog backup destination as FILE.

Recover the SAP HANA Database to a Specific Data Backup Without the Log/Catalog

  1. The restore to disk operation creates a JobID folder in the destination staging path. You can copy the data in separate folders within the JobID folder or to the same folder. For example, /stage_catalog/DB_MUL.

  2. Add user group permission to the local path where all the data are available.

    chown muladm:sapsys -R /stage_catalog/DB_MUL
  3. In SAP HANA studio, launch the recovery window, select Recover the database to a specific data backup, and then click Next.

    saphanastudio_recover1

  4. Select Recover without the backup catalog, and then click Next.

    saphanastudio_recover2

  5. Specify the Backup prefix, set the destination type as File, and then click Next.

    You will notice the Initialize log area, and Use delta backups greyed out, since we are not using log for restore.

    Note

    If you have any log/catalog in the log directory you have any log/catalog, then when restoring backup.log, the job shows recovery using catalog. If there is no catalog, the restore job will still complete without any issues, even though the message says failed to find the catalog file.

  6. Complete the job.

Recover the SAP HANA Database to a Point-in-Time

This recovery requires log backups to be replayed on top of the data that is restored. Since the logs are backed up to backint, you must convert the logs to disk log backup format. Use the hdbbackupdiag tool to convert the catalog file and read the logs that are restored to the disk location.

  1. The restore to disk operation creates a JobID folder in the destination staging path. You can copy the data and logs in separate folders within the JobID folder, or copy both data and logs to the same folder. For example, /stage_catalog/DB_MUL.

  2. Add user group permission to the local path where all the data and logs are available.

    chown muladm:sapsys -R /stage_catalog/DB_MUL
  3. Run the hdbbackupdiag utility as HANA OS user (<sid>adm), and provide the catalog file name with the time stamp , your data directory, and log directory.

    muladm@rhel7np:/usr/sap/MUL/HDB02> hdbbackupdiag -c /stage_catalog/log/DB_MUL/ log_backup_0_0_0_0.1615412520263 --generate --dataDir /stage_catalog/data/DB_MUL/ --logDirs /stage_catalog/log/DB_MUL/

    If catalog file is not available, create a new catalog file using the following command:

    abcadm@sde-newhana1:/stage_dir/DB_ABC> hdbbackupdiag --generate --dataDir /stage_dir/DB_ABC --logDirs /stage_dir/DB_ABC -d /stage_dir/DB_ABC

    Where:

    • dataDir is the directory of the data backups.

    • logDirs are the directories of the log backups

    • d is the target directory of the backup catalog

  4. In SAP HANA studio, launch the recovery window, select the tenant database that you want to recover, and then click Next.

  5. Select Recover as most recent state OR PIT, and then click Next.

  6. In the Locate Backup Catalog dialog box, select Search catalog in file system and enter the path to the logs folder.

    saphanastudio_recover3

  7. Click Next. The application stops the database, and then retrieves the list of backup jobs.

  8. From the list of available backups, select the backup that you want to restore, and then select Check Availability.

    The application checks if the required backup is available. After the Check Availability operation is complete, if the backup is available in the original location, in the Available column, the selected backup is marked with a green circle.

    saphanastudio_recoiver4

  9. Click Next.

  10. In the Locations box, enter the path where the logs are restored to, and then click Next.

    saphanstudio_recover5

  11. Select the Initialize Log Area check box, and then click Finish.

    saphanastudio_recover6

  12. To monitor the progress of the database recovery, view the backup.log under the HANA trace directory for the specific tenant database.

    saphanastudio_recover7

    Sample backup.log

    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY RECOVER DATA started [1617955709345]
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY command: RECOVER DATABASE FOR TST UNTIL TIMESTAMP '2022-04-09 08:08:25' CLEAR LOG USING CATALOG PATH ('/user1/196/usr/sap/TST/SYS/global/hdb/backint/DB_TST/') USING LOG PATH ('/niraj/196/usr/sap/TST/SYS/global/hdb/backint/DB_TST/') USING DATA PATH ('/user1/data/') USING BACKUP_ID 1617949793329 CHECK ACCESS USING FILE
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY using backup catalog 1617954819024 from /user1/196/usr/sap/TST/SYS/global/hdb/backint/DB_TST/log_backup_0_0_0_0.1617954748567
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY The following strategy is used:
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY from file: 190_D_DATA_BACKUP_databackup_differential_0_1617950676545_0_1 in /user1/data
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY from file: 186_COMPLETE_DATA_BACKUP_databackup_2_1 in /user1/data
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY from file: 190_D_DATA_BACKUP_databackup_differential_1617949793329_1617950676545_2_1 in /user1/data
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY from file: 186_COMPLETE_DATA_BACKUP_databackup_3_1 in /user1/data
    2021-04-09T13:38:29+05:30  P0018370      178b5ace1a1 INFO    RECOVERY from file: 190_D_DATA_BACKUP_databackup_differential_1617949793329_1617950676545_3_1 in /user1/data
    2021-04-09T13:40:50+05:30  P0018370      178b5ace1a1 INFO    RECOVERY progress of service: indexserver, sde-newhana2:30103, volume: 3, 100% 2/2
    2021-04-09T13:40:51+05:30  P0018370      178b5ace1a1 INFO    RECOVERY progress of service: xsengine, sde-newhana2:30107, volume: 2, 100% 2/2
    2021-04-09T13:40:51+05:30  P0018370      178b5ace1a1 INFO    RECOVERY state of service: indexserver, sde-newhana2:30103, volume: 3, RecoveryLogReplayFinished
    2021-04-09T13:40:52+05:30  P0018370      178b5ace1a1 INFO    RECOVERY state of service: xsengine, sde-newhana2:30107, volume: 2, RecoveryLogReplayFinished
    2021-04-09T13:40:58+05:30  P0018370      178b5ace1a1 INFO    RECOVERY state of service: indexserver, sde-newhana2:30103, volume: 3, RecoveryRestartCompleted
    2021-04-09T13:41:01+05:30  P0018370      178b5ace1a1 INFO    RECOVERY state of service: xsengine, sde-newhana2:30107, volume: 2, RecoveryRestartCompleted

Loading...