To restore and recover a single tenant from a persistent disk-based SAP HANA database backup, follow these steps.
Mount the backup
Use the management console to mount the backup to the target server:
- Stop the running HANA instance (required only for recovery to the source).
- Log into the management console to the Applications page.
- Select the database and select Access.
- Select the backup to recover and click Mount.
- On the Mount page, select the target Project name, Region, Zone, and target GCE instance name.
- Update the Data volume, Log volume, and Log backup volume mount location. (To ensure preflight succeeds, specify all mount locations that are unused.)
- Disable the Snapshot integrity check option.
- Run the Pre-Flight Check. If it fails, address the errors and run it again, then submit the job.
- Once the Mount job is completed successfully, you can see the mount points on the target host.
- If you recovered to the source, then restart the instance.
Recover a mounted single tenant database
Example variables used:
- Source DBSID: DM2
- Target DBSID: NVM (Must be pre configured on the target host.)
- Data Volume: /hana/data_2
- Log Volume: /hana/log_2
- Log Backup Volume: /hanabackup_2, /hana/backup_2_533788010
- Source Tenant: DM2 (data file locations: mnt00001/hdb00002.00003, mnt00001/hdb00003.00003)
- Target Tenant: NVM
Procedure
Log into the target host as root user and change the ownership of the files:
chown -R nvmadm:sapsys /hanabackup_2 /hana/backup_2_533788010
Confirm that the manifest file was created as part of the mount operation:
cd /act/touch cat dm2_HANA.manifest
Example output looks like this:
SYSTEMDB=mnt00001/hdb00001
DM2=mnt00001/hdb00002.00003:mnt00001/hdb00003.00003
Confirm that the necessary directory exists on the target server related to the tenant database displayed in the manifest file:
ls -ltr /hana/data/NVM/mnt00001/hdb00002.00003/ total 103252 -rw-r--r-- 1 nvmadm sapsys 0 Jun 13 20:11 __DO_NOT_TOUCH_FILES_IN_THIS_DIRECTORY__ -rw-r--r-- 1 nvmadm sapsys 269811712 Jun 14 19:26 datavolume_0000.dat ls -ltr /hana/data/NVM/mnt00001/hdb00003.00003/ total 3801248 -rw-r--r-- 1 nvmadm sapsys 0 Jun 13 20:11 __DO_NOT_TOUCH_FILES_IN_THIS_DIRECTORY__ -rw-r--r-- 1 nvmadm sapsys 3892314112 Jun 14 19:29 datavolume_0000.dat
Stop the tenant database on the target server:
hdbsql -U ACTBACKUP hdbsql SYSTEMDB=> alter system stop database NVM;
Copy the files from the mounted mount points to the target server mount point:
cp /hana/data_2/DM2/mnt00001/hdb00002.00003/* /hana/data/NVM/mnt00001/hdb00002.00003/ cp /hana/data_2/DM2/mnt00001/hdb00003.00003/* /hana/data/NVM/mnt00001/hdb00003.00003/
Ensure the permissions are changed for the copied files:
chown -R nvmadm:sapsys /hana/data/NVM/mnt00001/hdb00002.00003 chown -R nvmadm:sapsys /hana/data/NVM/mnt00001/hdb00003.00003
Check to ensure SYSTEMDB is started.
Recover the tenant database using point-in-time recovery.
- If the mounted database contains multiple log mount points, then pass the comma-separated mount points log path:
hdbsql -jAU ACTBACKUP RECOVER DATABASE FOR NVM UNTIL TIMESTAMP '2024-06-14 17:16:00' CLEAR LOG USING CATALOG PATH ('/hana/backup_2_533788010/log/DB_DM2') USING DATA PATH ('/hana/data/NVM') USING LOG PATH ('/hanabackup_2/log/DB_DM2','/hana/backup_2_533788010/log/DB_DM2') USING SNAPSHOT CHECK ACCESS USING FILE;
- If you are recovering from database image only then use this command:
hdbsql -jAU ACTBACKUP RECOVER DATA FOR $TSID USING SNAPSHOT CLEAR LOG
Once the tenant database is recovered, check the status of the database:
hdbsql -jAU ACTBACKUP hdbsql SYSTEMDB=> select * from m_databases; | DATABASE | DESCRIPTION | ACT | ACTIVE | OS_USER | OS_GROUP | RESTART | F | | -------- | --------------- | --- | ------ | -------- | -------- | ------- | - | | SYSTEMDB | SystemDB-NVM-00 | YES | ACTIVE | | | DEFAULT | ? | | NVM | NVM-00 | YES | ACTIVE | | | DEFAULT | ? |
Perform unmount & delete (to remove backup disks /hana/data_2, etc).