1950261 - SAP HANA Database Backup Policy Recommendations and Regular Backup Script
=====Symptom
For SAP Business One, version for SAP HANA users, SAP HANA provides a range of database backup and recovery functions. You must follow the instructions in the SAP HANA Administration Guide at http://help.sap.com/hana_appliance to back up your database.
This note offers additional recommendations on developing a backup policy for your SAP HANA database. Besides, you can use the attached script to enable regular auto-backup.
======Solution
Recommended Backup Policy:
Note: The attached script supports SAP HANA SPS 06 and above.
Note: For a fully automated backup solution, please use the SAP Business One RSP backup solution.
Note: If you intend to use a non-default path as the backup location,you should ensure the backup folders have the following privileges.
• The folder's owner is the sid user (e.g. ndbadm) and the user group is sapsys.
• The folder's privilege is 771.
You can change the backup folder path by performing the following steps:
- Log on to Linux server as root and execute the below commands to grant the privileges:
• chown - In SAP HANA studio, navigate to
- Restart SAP HANA database
- Make the following preparations:
o Create a backup user with the BACKUP OPERATOR system privilege and create a user key in the user store, as below: - In the SQL console of the SAP HANA studio, execute the following SQL statements as an administrative user (e.g. SYSTEM):
create user Log on to the Linux server as the ndbadm user and execute the following command in a terminal:
hdbuserstore set USER4BACKUP localhost:3- Do the following to set up a regular automatic backup schedule:
Copy the attached shell file BackupScript.sh (unzipped) to the home directory of the sid user (e.g. /usr/sap/NDB/HDB00/).
- Schedule the backup job in cron as the sid user (e.g. ndbadm), using the command crontab -e.
Example:
30 05 * * * /usr/bin/sh /usr/sap/NDB/HDB00/BackupScript.sh 2>> /usr/sap/NDB/HDB00/backup.log
The backup job is scheduled to run at 5:30 a.m. each day. - Perform the following administrative tasks every day or based on your backup schedule:
o Check backup.log under the home directory of the sid user (e.g. /usr/sap/NDB/HDB00/).
o Check the latest backup and store a copy on an external location, as below: - In the SAP HANA studio, double-click the Backup folder under your system.
- In the Backup editor, on the Backup Catalog tab, check the status of the appropriate backup (see the attachment BackupStatus.png).
- Copy the backup to a storage location or medium somewhere other than the SAP HANA server.
You can find the backup's current location in the backup details as well (see the attachment BackupStatus.png).
o Delete all backups that are beyond the determined time point to ensure that there is enough space for SAP HANA database's normal operations, as below: - In the Backup editor, on the Backup Catalog tab, right-click the oldest backup that you want to retain and select Delete Older Backups.
- In the Backup Deletion of System xxx window, on the Specify Backup Deletion Settings page, select Catalog and backup location and File system (see the attachment BackupDeletion.png), and then choose the Next button.
- On the Review Backup Deletion Settings page, choose the Finish button.
Confirm the deletion.
SAP HANA starts deleting selected data in the background. You can continue with other operations.Perform the following administrative tasks on a regular basis as appropriate:
o Check the backup.log file to monitor backup activities. This file is generated in the same storage place as the script.
o Delete backup copies on external storage that are old enough.