SAP HANA
This section provides information to help you configure your SAP HANA database to work with CxLink backup. It also provides information about the backup storage paths and guidelines to help you perform backup and restore operations.
Topics
Where is the configuration file?
After CxLink Backup setup is done, the configuration file is located in the following path:
/hana/shared/$SAPSYSTEMNAME/global/hdb/opt/conf/emory.cfg
Configure backint-related parameters
As part of any Third-Party Backup Tool configuration, as described in Backup Configuration Parameters in the SAP HANA Administration Guide, before you start using CxLink Backup, you must set the following SAP HANA parameters. These parameters will configure SAP HANA to send the backups to the CxLink Backup agent instead of using a disk storage target.
_14[backup]_14data_backup_parameter_file = /usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg_14catalog_backup_parameter_file = /usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg_14catalog_backup_using_backint = true_14log_backup_parameter_file = /usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg_14log_backup_using_backint = true_14data_backup_buffer_size = 4096_14parallel_data_backup_backint_channels = 8_14_14[communication]_14tcp_backlog = 2048_14_14[persistence]_14enable_auto_log_backup = yes
For parallel backint channels check SAP Note 2458043 - SAP HANA Multistreaming Backup to Backint does not work for the proper parameters.
Use one of the following methods to configure the parameters:
- HANA Studio
- Command Line
- SQL Commands
- Open Hana Studio and connect to the SYSTEMDB database.
- Select
Configuration and Monitoring
->Open Administration
- Open to the Configuration tab.
- Modify the values in the [global.ini][backup] section.
-
SSH to your SAP HANA Database server as the SAP HANA Administrator User (sidadm).
-
Navigate to the HANA configuration directory
_10cd /hana/shared/$SAPSYSTEMNAME/global/hdb/custom/config -
Modify file global.ini using your prefered text editor.
_10vi global.ini-or-
_10nano global.ini -
Add the parameters at the beginning of the page:
Change SIDRemember to change <SID> with your correct SAPSYSTEMNAME
-
Save the file and restart your SAP HANA instance.
-
Open a database session by using HANA Studio or hdbsql
-
On the session opened, paste the following contents
Change SIDRemember to change <SID> with your correct SAPSYSTEMNAME
_13# Backup parameters_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'data_backup_parameter_file') = '/usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg' WITH RECONFIGURE;_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'catalog_backup_parameter_file') = '/usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg' WITH RECONFIGURE;_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'catalog_backup_using_backint') = 'true' WITH RECONFIGURE;_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'log_backup_parameter_file') = '/usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg' WITH RECONFIGURE;_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'log_backup_using_backint') = 'true' WITH RECONFIGURE;_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'parallel_data_backup_backint_channels') = '8' WITH RECONFIGURE;_13_13# Communication_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'communication', 'tcp_backlog') = '2048' WITH RECONFIGURE;_13_13# Persistence_13ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'data_backup_buffer_size') = '4096' WITH RECONFIGURE;
Backup and restore your database - SQL statements
The following are examples of SQL statements that you can use to perform backup and recovery. For more details, refer to the SAP, SAP HANA Administration, or SQL Reference guides.
Full Backup
Use the following syntax to perform backups on a single-tenant instance or on a multi-tenant SYSTEMDB database.
_10BACKUP DATA USING BACKINT ('<BACKUP_PREFIX>')
Use the following syntax to perform backups for a Tenant database.
_10BACKUP DATA FOR <TENANT_DB_NAME> USING BACKINT ('<BACKUP_PREFIX>')
Differential Backups
Use the following syntax to perform backups for a Tenant database
_10BACKUP DATA DIFFERENTIAL FOR <TENANT_DB_NAME> USING BACKINT ('<BACKUP_PREFIX>')
Incremental Backups
Use the following syntax to perform backups for a Tenant database
_10BACKUP DATA INCREMENTAL FOR <TENANT_DB_NAME> USING BACKINT ('<BACKUP_PREFIX>')
Recover database
-
Recover a Tenant database to a specific point in time:
_10RECOVER DATABASE FOR <TENANT_DB_NAME> UNTIL TIMESTAMP 'YYYY-MM-DD HH:MM:SS' USING CATALOG BACKINT CHECK ACCESS USING BACKINT -
Recover from a specific backup_id:
_10RECOVER DATA FOR <TENANT_DB_NAME> USING BACKUP_ID 1234567890123 USING CATALOG BACKINT USING DATA PATH ('/usr/sap/<SID>/SYS/global/hdb/backint/DB_<TENANT_DB_NAME>/') CLEAR LOG
System Copies
CxLink Backup allows you to perform system copies by restoring a backup of a different database into the target database. CxLink Backup agent should be installed in the target database server and it should be able to access the Amazon S3 bucket where the backups of the source system are stored.
_10RECOVER DATA FOR <TARGET TENANT_DB> USING SOURCE '<SOURCE TENANT_DB>@<SOURCE HANA SID>' USING CATALOG BACKINT CLEAR LOG;
If you are performing a system copy across two different AWS accounts, ensure that you have the appropriate IAM permissions and Amazon S3 bucket policies in place. See the Identity and Access Management section in this document for details.
Backup and restore your database - SAP HANA Studio or Cockpit
In addition to using SQL statements, you can initiate the backup and recovery process from SAP HANA Cockpit or SAP HANA Studio. For more information, see Backup and Recovery and Reference: Backup Console (SAP HANA Studio) in the SAP documentation. Ensure that you are using the latest version of SAP HANA Cockpit or SAP HANA studio to get all of the latest features from SAP.
Scheduling and managing backups
You can use SAP HANA Cockpit to schedule periodic backups of your target SAP HANA database, including log backups. Ensure that you choose Backint as the backup type when scheduling your backup. For more details, see Schedule Backups in the SAP HANA Administration with SAP HANA Cockpit Guide.
Retention Policies
Beginning with SAP HANA 2 SPS 03, you can use SAP HANA Cockpit to set the retention policies for your SAP HANA database backups. Based on your retention policies, SAP HANA Cockpit can automatically trigger jobs to delete old backups from catalogs, as well as the physical backups. This process also automatically deletes backup files stored in your Amazon S3 buckets. For more information, see “Retention Policy” under Backup Configuration Settings in the SAP HANA Administration with SAP HANA Cockpit Guide.
Where are your backups stored?
Your backups will be stored in the target bucket following these formatting:
<SAP_SID>/<DB>/<year>/<month>/<day>/<backup_file_name>.<backup_id>
All backup files from the same backup will have the exact same suffix. These can help you to identify the objects of a specific backup.
Example:
HDB/SYSTEMDB/2020/05/01/COMPLETE_DATA_BACKUP_databackup_0_1.1589970887300