4 4 3 Tigon:SAP HANA Backup
- 1 Overview
- 2 Configuring SAP HANA as a client on SEP sesam Server
- 3 Installing and configuring SAP HANA module on the database server
- 4 Backing up SAP HANA
- 5 SAP HANA housekeeping
- 6 Details of script and parameters
- 7 Troubleshooting installation: Manual installation
- 8 See also
- 9 External reference
SEP sesam provides efficient data protection for your SAP HANA environment. Among the main technical advantages for using the SEP sesam HDBBackint integration to back up your SAP HANA database are:
- SEP sesam HDBBackint integration is certified and supported by SAP.
- Data consistency checks at the block level.
- Ease of use due to integration into SAP HANA Studio.
- Integration into your existing backup infrastructure.
- Additional backup-efficient features, such as deduplication for eliminating redundant backup data.
- Backups are immediately available for recovery.
- Only allocated data size has to be backed up.
- High automation is possible.
As of SEP sesam v. 4.4.3 Beefalo V2, you can perform SAP HANA housekeeping to delete (purge) SEP sesam backups that are no longer needed or can no longer be used for a recovery, based on a defined retention policy. For details, see section SAP HANA housekeeping.
To ensure error-free operation of SEP sesam and improve performance, make sure that the following conditions are met:
- Check the support matrix for the list of supported SAP HANA versions.
- Installed SAP HANA database.
- Installed SEP sesam Client for Linux version ≥ 188.8.131.52 on the SAP HANA server (≥ 184.108.40.206 for IBM ppc64).
- Regular file backups must work (the sample /etc backup has to be successful). For details on backup configuration, see Standard Backup Procedure.
Configuring SAP HANA as a client on SEP sesam Server
- Add the SAP HANA server as a SEP sesam Client in the SEP sesam GUI and check that access mode is SM SSH.
- Create a backup task HANA <DB_SID> with SAP HANA task type and <DB_SID> as a source. For general details on backup procedure, see Creating a Backup Task. Note that SAP HANA task cannot be used for regular file backups. It is necessary only for enabling the SEP sesam Server to accept backups from the SAP HANA system; once all configuration steps are performed, this task is used to transport the database and log backups to the SEP sesam Server or RDS.
- Create a backup task to back up SAP HANA config files and all other required files by specifying all files except the database files and HANA_CONFIG as a source.
The files are located in the following directories:
- Global config files:
- Local config files (on each host):
Installing and configuring SAP HANA module on the database server
The installation procedure differs depending on your SAP HANA version and SEP sesam version. The following instructions are relevant for Beefalo V2. To get the latest sm_install_saphana2.sh script, email SEP sesam support.
- On the HANA server, login as root user and run sm_install_saphana script. The script installs the module and generates the parameter according to the values you entered during its execution. Proceed as follows according to your version:
SAP HANA v. ≥ 2.0
You can run the following sm_install_saphana2 script by using either SAP (root) user key or SAP HANA backup user password.
|You have to run the script for each database in your instance (SYSTEMDB, TenantDB1, TenantDB2, ... TenantDB<number>).|
- Running the script by using the SAP user key
sm_install_saphana2 -s <SID_name> -i <instance_number> -U <user_key> -D <database> -j <backup_task_name> -m <media_pool_for_DB_backup> -C <server_hostname>
sm_install_saphana2 -s SEP -i 90 -U BackupUser -D SYSTEMDB -j HANA_SystemDB -m MP_HANA -C backup-srv.sep.de <SID_name>= SEP <instance_number>= 90 <user_key>= BackupUser (For details, see Using a User Key when Logging On to a Database.) <database>= SYSTEMDB <backup_task_name>= HANA_SystemDB <media_pool_for_DB_backup>= MP_HANA <server_hostname>= backup-server.sep.de
sm_install_saphana2 -s <SID_name> -i <instance_number> -u <username> -p <password> -D <database> -j <backup_task_name> -m <media_pool_for_DB_backup> -l <media_pool_for_log_backup> -C <server_hostname> -S <RDS_hostname> -d <drive_number>
sm_install_saphana2 -s SH2 -i 01 -u SYSTEM -p secret! -D PRD -j HANA_Production_DB -m MP_HANA_DB -l MP_HANA_LOG -C backup-server.sep.de -S rds01.sep.de -d 7 <SID_name>= SH2 <instance_number>= 01 <username>= SYSTEM <password>= secret! <database>= PRD <backup_task_name>= HANA_Production_DB <media_pool_for_DB_backup>= MP_HANA_DB <media_pool_for_log_backup>= MP_HANA_LOG <server_hostname>= backup-server.sep.de <RDS_hostname>= rds01.sep.de <drive_number>= 7 (exclusive reserved drive for SAP HANA backups, for best performance create a separate drive)
SAP HANA v. < 2.0
The command differs for single and multi instance as follows:
- SAP HANA single instance
/opt/sesam/bin/sesam/sm_install_saphana -C <server_hostname> -j hana_backup_task -m sesam_media_pool -l sesam_media_pool -s <SID_name> -i <instance_number> -u <username> -p <password>
where hana_backup_task is the name of the task you created before and the same sesam_media_pool is specified twice in the given command!
For each instance, run the following command:
/opt/sesam/bin/sesam/sm_install_saphana -C <server_hostname> -j hana_backup_task -m sesam_media_pool -l sesam_media_pool -s <SID_name> -i <instance_number> -u SYSTEM -p <password> -M
where hana_backup_task is the name of the task you created before, <SID_name> is for example H02, <instance_number> is for example 04, and the same sesam_media_pool is specified twice in the given command!
- Backint Agent should be /opt/sesam/bin/sesam/hdbbackint.
- Make sure that the Destination type has changed from file to BACKINT.
Configure backup for SAP HANA backup catalog
The SAP HANA backup catalog registers all backups and contains all backup history details. It enables SAP HANA to check and validate whether recovery is possible, which backups are required for recovery and which backups are no longer needed. Note that the backup catalog does not record the progress of a backup; this is done by the backup.log.
|Backup catalog is mandatory to be able to restore the SAP HANA instance to a different system! Make sure that you configure backup for SAP HANA catalog as described below.|
The following screenshot shows the parameters that have to be set in order for SAP HANA to write its backup catalog to SEP sesam. The backup catalog will then be backed up during the LOG backup of the HANA instance.
Backing up SAP HANA
- To verify the configuration, start full backup from HANA studio: Open the SAP HANA Studio, right-click Backup under the desired system and select Back Up... from the context menu. Then select Backint as backup target, as shown in the screenshot below.
You have to wait for backup to be completed successfully (BACKUP STATUS: Backup was successful). You should also see the corresponding backup activity on the SEP sesam Server side.
- If this first backup completes successfully, you can proceed and configure automatic backups.
- If the first backup fails, check the following:
- Open the
/var/opt/sesam/var/ini/backint_saphana.utlfile and check that the path and the directory names are correct (directory names are case sensitive).
- Make sure that
/var/opt/sesam/var/log/lgcis writable for your <sid>adm operating system user. You can also work around this issue by executing
chmod 777 /var/opt/sesam/var/log/lgcin the command line. Note that it is strongly recommended to give the write permissions only to your <sid>adm user.
You can find additional troubleshooting information in the hdbbackint log file in the
/var/opt/sesam/var/log/lgcdirectory and in the SAP HANA troubleshooting.
- Open the
- SAP HANA single instance installations only
#!/bin/sh # Example script for starting a full SAP HANA database backup # Create a unique backup prefix using the current timestamp PREFIX="COMPLETE_DATA_BACKUP_`date "+%Y-%m-%d_%H-%M-%S"`_`hostname -s`" echo "Backup Prefix is: $PREFIX" # Start backup via hdbsql query echo "Starting backup via hdbsql..." /usr/sap/<SID>/HDB<InstanceNumber>/exe/hdbsql -i 0 -n localhost -u SYSTEM -p PASSWORD" BACKUP DATA USING BACKINT ('$PREFIX')" # -i <instanceNumber>, -n <node>, -u <dbuser> # Multi tenancy only: -d <database> has to be added and the SQL command is "BACKUP DATA FOR <tenant_db_name> USING BACKINT ('$PREFIX')" # Possible backup levels are DIFFERENTIAL and INCREMENTAL. --> example: "BACKUP DATA DIFFERENTIAL [FOR <tenant_db_name>] USING BACKINT ('$PREFIX'_DIFF)" # Collect exit code of hdbsql and pass it as exit code of this backup script EXIT_CODE=$? exit $EXIT_CODE
- In the example script above, change the text in red to match your settings
<SID>/HDB<InstanceNumber>– make sure that you use the correct directory
-u SYSTEM -p PASSWORD– specify username of the system user (which is most of the time SYSTEM) and the password
- SAP HANA multi instance installations
#!/bin/sh # Example script for starting a full SAP HANA database backup # Create a unique backup prefix using the current timestamp PREFIX="COMPLETE_DATA_BACKUP_`date "+%Y-%m-%d_%H-%M-%S"`_`hostname -s`" echo "Backup Prefix is: $PREFIX" # Start backup via hdbsql query echo "Starting backup via hdbsql..." #Backup of the first tenant over the system DB /usr/sap/H02/HDB10/exe/hdbsql -i 00 -n localhost -d SYSTEMDB -u SYSTEM -p PASSWORD "BACKUP DATA FOR TDW USING BACKINT ('$PREFIX')" #The following lines are examples to backup more tenants. In case you need it, remove the # #/usr/sap/H02/HDB10/exe/hdbsql -i 00 -n localhost -d SYSTEMDB -u SYSTEM -p PASSWORD #"BACKUP DATA FOR TD1 USING BACKINT ('$PREFIX')" #/usr/sap/H02/HDB10/exe/hdbsql -i 00 -n localhost -d SYSTEMDB -u SYSTEM -p PASSWORD #"BACKUP DATA FOR TD2 USING BACKINT ('$PREFIX')" #Backup of the SYSTEMDB /usr/sap/H02/HDB10/exe/hdbsql -i 00 -n localhost -d SYSTEMDB -u SYSTEM -p PASSWORD "BACKUP DATA FOR SYSTEMDB USING BACKINT ('$PREFIX')" # Collect exit code of hdbsql and pass it as exit code of this backup script EXIT_CODE=$? exit $EXIT_CODE
- In the example script above, change the text in red to match your settings:
H02/HDB10– make sure that you use the correct directory
-u SYSTEM -p PASSWORD– specify username of the system user (which is most of the time SYSTEM) and the password
TDW– the actual name of the tenant/DB
/opt/sesam/bin/sesam). The command event will execute the backup script. For general details on command event configuration, see Creating a Command Event.
|The FDI backup chain can be orphaned in case of problems with the operations order or the time. For example, when FDI is diplayed as IIIIIIIII, EOL is disabled.|
For further information, please refer to the SAP HANA Administration Guide and the SAP HANA SQL and System Views Reference (SQL Statements -> BACKUP DATA).
SAP HANA housekeeping
With 4.4.3 Beefalo V2, you can use SAP HANA housekeeping to delete (purge) SEP sesam backups that are no longer needed or can no longer be used for recovery. SEP sesam handles the housekeeping of backups by deleting the stored savesets and their corresponding entries from the list of available backups.
There are three different ways to perform SAP HANA housekeeping by running the relevant commands on the SAP HANA server.
- Purge only
sbc_hana.sh -A purge -C <SEP_sesam_Server> -j <SEP_sesam_task> <db_name>
/opt/sesam/bin/sesam/sbc_hana.sh -A purge -U backupuser -C http://meteorologix2.sep.de:11051 -j sap-hana-systemdb HDB/00/SYSTEMDB
sbc_hana.sh -b -o purge -C <SEP_sesam_Server> -j <SEP_sesam_task> <db_name>
/opt/sesam/bin/sesam/sbc_hana.sh -b -l FULL -U backupuser -C http://meteorologix2.sep.de:11051 -j sap-hana-hdb -o purge /HDB/00/HDB
sbc_hana.sh -b -o purge <db_name>
/opt/sesam/bin/sesam/sbc_hana.sh -b -l FULL -U backupuser -o purge HDB/00/HDB
Details of script and parameters
Usage of sm_install_saphana script
sm_install_saphana is one-line installation utility that can be executed from the SEP sesam bin directory (default:
/opt/sesam/bin/sesam. If you encounter errors during the installation process, you may have to manually install
the SAP HANA extension, as described in section Manual installation. If you are using multi-tenancy feature, double-check the backint settings in the SAP HANA Studio as shown in step Verify Backint Settings.
Optional arguments of sm_install_saphana script:
-h, --help show this help message and exit -C <server_hostname> SEP sesam Server hostname -j <backup_task_name> Backup task name -m <media_pool_for_DB_backup> Target media pool for DB backup -l <media_pool_for_log_backup> Target media pool for log backup -S <RDS_hostname> SEP sesam Remote Device Server -d <drive_number> SEP sesam drive number -M SAP HANA Multitenancy -s <SID_name> SAP HANA SID -i <instance_number> SAP HANA instance number -u <username> SAP HANA backup user -p <password> SAP HANA backup user password -n <hostname> SAP HANA hostname (hdbsql connection) -D <database> SAP HANA database name -U <user_key> SAP HANA key of the user
SAP HANA parameter file
If you have used the sm_install_saphana setup utility for installing the module, the parameter file has already been generated and registered, according to the values you entered during the execution of the script. You may have to go through these steps if some of the criteria for the automatic installation could not be met.
You can use different parameter files for different purposes (e.g., to store backups in different media pools). The parameter file used is declared by the -P PARAMETERFILE option for hdbbackint. During installation, a template parameter file is copied to
/var/opt/sesam/var/ini/backint_saphana.utl. You can edit the parameter file and adjust it to suite your environment. Note that all specified parameters are case sensitive.
At least the following entries are mandatory to be configured in the parameter file:
- SESAM_SERVER=<Sesam Server>
- Hostname of the SEP sesam Server you want to send the backup to
- SESAM_JOB=<Sesam SAP Client Task>
- Name of the backup task created during configuration
- SESAM_DRIVE=<Sesam Drive Number>
- Number of the SEP sesam drive that you want the backup to be written to
- SESAM_POOL=<Sesam Mediapool>
- Exact name of the SEP sesam media pool that you want to store the backup in
- SSB_LOGFILE=<Log file name>
- Full path of the SEP sesam backint log file
|Instead of having only one large log file, you can get a new log file from backint by specifying a date identifier in the log file name. The strftime function is used for expansion. The $u token is replaced by SAP DB user, set from SAP side in backint call.
Additional optional configuration parameters are:
- Full path of the SEP sesam backup client executable. It only has to be set if the standard sbc cannot be used.
- PORT=<Sesam Server Communication Port>
- Only necessary if the STPD port was changed during SEP sesam Server installation.
- SESAM_TAPESERVER=<Remote device server>
- Hostname of the RDS that you want to send the backup to. The backup net to be used can be chosen by this entry. Note that the specified hostname here has to match the hostname of the device server which is visible in the used drive's properties.
Example of a parameter (.utl) file in
SESAM_SERVER=Serverix SESAM_JOB=sep-hana-sesam-log SESAM_DRIVE=2 SESAM_POOL=Daily SSB_LOGFILE=/var/opt/sesam/var/log/lgc/backint_saphana_log.log
Troubleshooting installation: Manual installation
Note that these instructions work with the default SAP HANA directories. You may have to adjust every path in the commands to the path that you have used in a customized installation.
- Create the directories needed for the hdbbackint binary and utility file:
- Copy the parameter file template from the skel/templates to the SEP sesam ini directory.
- Adjust the permissions of the SEP sesam logging directory.
- Create a symbolic link from
/opt/sesam/bin/sesam/hdbbackintto the directory where SAP HANA expects the backint executable.
Note that usually root permissions are required. The configuration has to be adjusted accordingly. The file must be executable for the SAP HANA user.
- Create another symbolic link from
/var/opt/sesam/var/ini/backint_saphana.utlto the directory where SAP HANA expects the parameter file:
- Check if the programs sbc and sbc_com_interface in the directory
<SESAM DIR>/bin/sesamare executable for the SAP HANA user.
- Repeat steps 1-6 on every node of a scale-out system, if given.
root@hanasrv:~# mkdir -p /usr/sap/<SID>/SYS/global/hdb/opt/hdbconfig
root@hanasrv:~# cp /opt/sesam/skel/templates/backint_saphana.utl /var/opt/sesam/var/ini/
root@hanasrv:~# chmod 777 /var/opt/sesam/var/log/lgc
root@hanasrv:~# ln -s /opt/sesam/bin/sesam/hdbbackint /usr/sap/<SID>/SYS/global/hdb/opt/hdbbackint
root@hanasrv:~# ln -s /var/opt/sesam/var/ini/backint_saphana.utl /usr/sap/<SID>/SYS/global/hdb/opt/hdbconfig/