I have followed the standard HANA Admin guide and created below instructions with screenshot which can be helpful for the first timer.For details information you MUST go through the Standard HANA Admin Guide.
After a database failure, for example due to a hardware error, you can recover your database or revert it to an earlier state by importing data backups or a storage snapshot and log backups.
You can recover a SAP HANA single database using a data backup or storage snapshot and log backups. You can recover a system or tenant database in a solution with SAP HANA multi-tenant database containers using a data backup and log backups only. The recovery of a tenant database is performed via the relevant system database. Snapshots are not supported yet.
The documentation pertains to the technical steps required to recover a SAP HANA DB using HANA Studio.
1. Pre Task before Recovery
1.1 Log on Group Creation
This is just for testing purpose so that we can validate the restore.
T-Code : SMLG
Logon Group : SPACE assigned
2. License Key and Recovery
SAP HANA license key becomes invalid if the SID or landscape ID is changed. During recovery, a temporary license key is installed automatically if the backup used for recovery had a permanent license.
If the backup used for recovery had only a temporary license, the system will be locked immediately after recovery.
Because the new recovered SAP HANA system has a new landscape ID, the SAP HANA license for the source system cannot immediately be applied to the new SAP HANA system.
You can work with the automatically installed temporary license for up to 90 days. During this time, you need to request a new license key from SAP, and install it in the new recovered SAP HANA system.
3. Availability of Backups
At the beginning of a recovery, the master name server performs availability checks.If you are working with file-based backups, and shared backup storage is not being used, it is not possible to perform these availability checks. If recovery-relevant data is not available at the beginning of the recovery, this might therefore not be detected until after the recovery has started. The recovery can then be started, but will fail.To recover the database, you need at least one data backup or at least one storage snapshot.
At the beginning of a recovery, all the data and log backups to be used must be either accessible in the file system or available through the third-party backup tool.
If you are recovering the database from a storage snapshot, the storage snapshot must be available in the data area.
Login to DB host and check the availability.
4. Determining and Checking Backups for Recovery (hdbbackupdiag Tool)
By calling hdbbackupdiag with the –check option, you can verify if the available backups are suitable for recovering the HANA database at a particular time. The backups used may be present in any directory in the file system or in an external backup tool.
The hdbbackupdiag tool determines which backups are required to comply with the required point in time and checks whether these backups are available and accessible. It then executes the following checks:
For backups that were written to the file system:
– the file is contained in the file system either at the location to which it was written or at a location specified by a search path
– the current operating system user has read authorization for the file
– the file is large enough to accommodate the usable load stored at the start of the file
– the file’s backup ID corresponds to the backup ID specified in the backup catalog
hdbbackupdiag –check -f -d /mnt/resource/logbackup/
-d <directory>: Specify the directory in which you are searching for the backup catalog. If this option is not available, a search is carried out for the latest version of the backup catalog in the current directory and, if necessary, in the directories specified with –logDirs and in the external
The hdbbackupdiag tool does not check the content of the backups for consistency. To check individual backups for consistency, you can use the program hdbbackupcheck (see SAP Note 1869119).
hdbbackupcheck -v /mnt/resource/backup/<SID>_bkp_XXXXX/COMPLETE_DATA_BACKUP_databackup_0_1
hdbbackupcheck -v /mnt/resource/backup/<SID>_bkp_XXXXX/COMPLETE_DATA_BACKUP_databackup_1_1
hdbbackupcheck -v /mnt/resource/backup/<SID>_bkp_XXXXX/COMPLETE_DATA_BACKUP_databackup_2_1
hdbbackupcheck -v /mnt/resource/backup/<SID>_bkp_XXXXX/COMPLETE_DATA_BACKUP_databackup_3_1
hdbbackupcheck -v /mnt/resource/backup/<SID>_bkp_XXXXX/COMPLETE_DATA_BACKUP_databackup_4_1
4.1 Back Up Catalog
The backup catalog is stored in the SAP HANA database and is part of the log backups. This allows access to the backup catalog during recovery. Even in situations such as when log mode overwrite is set, where logs backups are not written, the backup catalog is still backed up. The backup catalog is backed up and versioned after every completed backup operation. If the backup catalog is saved using a third-party backup tool, the versioning of the backup catalog is handled by the backup tool.
SAP Note 1812980 provides more information about the backup catalog.
5. Recover the Database (SAP HANA Studio)
To recover an SAP HANA single database or SAP HANA multi-tenant database containers, you are strongly advised to use SAP HANA studio. You can also recover them using SQL statements, however.
- SAP HANA single databases:-You can recover SAP HANA single databases, and the system database or a tenant database of SAP HANA multitenant database containers. SAP HANA single databases can be restored using complete data backups or snapshots, and log backups, with several recovery options.
With SAP HANA single databases, SQL statements for recovery cannot be executed using the normal SQL clients such as HDBSQL, and cannot be executed when the database is online. The recoverSys.py script is therefore used to pass SQL statements to SAP HANA single databases. The SAP HANA single database must be offline for recovery using SQL statements.
Before starting a recovery or system copy, bear the following in mind:
- You cannot pause and resume a database recovery or system copy.
- You can cancel the process while it is running. However, canceling a recovery or system copy makes the database state inconsistent. SAP HANA prevents an inconsistent database from being started. To be able to work with the database again, you would need to perform the recovery or system copy again.
If an error occurs during the recovery or system copy process, you have to repeat the entire process.
- In SAP HANA studio, open the Systems view. For a SAP HANA single database, right-click over the system to be recovered, and choose Backup and Recovery–>Recover System.
Provide Password : #######
Run in Background.
Depending on the recovery type specified, provide the required information:
Choose the appropriate Radio Button.
Recover the database to its most recent state/Recover the database to the following point in time
The system lists all the relevant data backups and storage snapshots.
Specify the location of the log backups if they are not in the default location.
Recover the database to a specific data backup or storage snapshot
Select the destination type (File, Backint, or storage snapshot)
You can select a backup or storage snapshot from the backup catalog or specify the location of a backup or storage snapshot without using the backup catalog.
To make sure that the selected item is at the specified location, choose Check Availability. If the system indicates that the data backup is not available at the selected location, and you know that it has been moved, you can specify an alternative location to be checked.
The progress of the recovery for each SAP HANA service is displayed in the dialog box. When the recovery is complete, a message confirms this and shows the time stamp when the recovery was completed.
The SAP HANA database is online.
6. Customer-Specific Configuration Files
The SAP HANA default database configuration files are installed during database installation. Posterior changes to database parameters are stored in customer-specific configuration files. Their values overrule the values in the default database configuration files.
Host-specific settings override database-specific settings, which override system/global settings, which override the default settings.
Range of Validity
Global configuration settings
Database-specific configuration settings
(valid for SAP HANA multitenant database containers only)
Host-specific configuration settings
Copy all of them to the correct location from the backup.
7. Verification of successful Restore
Log into SAP
7.1 Verify Logon Group
- SPACE has gone which we created before restore.