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


As part of any Third-Party Backup Tool configuration, as described in Backup Configuration Parametersopen in new window 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.

[backup]
data_backup_parameter_file = /usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg
catalog_backup_parameter_file = /usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg
catalog_backup_using_backint = true
log_backup_parameter_file = /usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg
log_backup_using_backint = true
data_backup_buffer_size = 4096
parallel_data_backup_backint_channels = 8

[communication]
tcp_backlog = 2048

[persistence]
enable_auto_log_backup = yes 

TIP

For parallel backint channels check SAP Note 2458043 - SAP HANA Multistreaming Backup to Backint does not workopen in new window for the proper parameters.

Use one of the following methods to configure the parameters:


Using HANA Studio

  1. Open Hana Studio and connect to the SYSTEMDB database.
  2. Select Configuration and Monitoring -> Open Administration
  3. Open to the Configuration tab.
  4. Modify the values in the [global.ini][backup] section.

Using Command Line

  1. SSH to your SAP HANA Database server as the SAP HANA Administrator User (sidadm).
  2. Navigate to the HANA configuration directory
cd /hana/shared/$SAPSYSTEMNAME/global/hdb/custom/config
  1. Modify file global.ini using your prefered text editor.
vi global.ini

-or-

nano global.ini
  1. Add the parameters at the beginning of the file:

Change SID

Remember to change <SID> with your correct SAPSYSTEMNAME

  1. Save the file and restart your SAP HANA instance.

Using SQL Commands

  1. Open a database session by using HANA Studio or hdbsql
  2. On the session opened, paste the following contents, remembering to change the <SID> for your current SAP System Name :
    # Backup parameters
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'data_backup_parameter_file') = '/usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg' WITH RECONFIGURE;
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'catalog_backup_parameter_file') = '/usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg' WITH RECONFIGURE; 
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'catalog_backup_using_backint') = 'true' WITH RECONFIGURE;
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'log_backup_parameter_file') = '/usr/sap/<SID>/SYS/global/hdb/opt/conf/emory.cfg' WITH RECONFIGURE;
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'log_backup_using_backint') = 'true' WITH RECONFIGURE;
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'parallel_data_backup_backint_channels') = '8' WITH RECONFIGURE;
    
    # Communication
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'communication', 'tcp_backlog') = '2048' WITH RECONFIGURE;
    
    # Persistence
    ALTER SYSTEM ALTER CONFIGURATION ( 'global.ini', 'SYSTEM' ) SET( 'backup', 'data_backup_buffer_size') = '4096' WITH RECONFIGURE;
    

Configure database specific options

In this section you will find the specific configuration settings modifiable for SAP HANA. All the modifiable values will be listed in the Specific Database configuration for HANA database section in CxLink Backup menu:

WARNING

Currently there is no configuration needed in a SAP HANA Database to run CxLink Backup.


Backup and restore your database

Once CxLink Backup agent is installed and configured on your SAP Database Server, you can initiate backup and recovery using SQL statements, SAP HANA Cockpit, or SAP HANA Studio.

Using 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 Backups

Use the following syntax to perform backups on a single-tenant instance or on a multi-tenant SYSTEMDB database.

BACKUP DATA USING BACKINT ('<BACKUP_PREFIX>')

Use the following syntax to perform backups for a Tenant database.

BACKUP DATA FOR <TENANT_DB_NAME> USING BACKINT ('<BACKUP_PREFIX>')

Differential Backups

Use the following syntax to perform backups for a Tenant database

BACKUP DATA DIFFERENTIAL FOR <TENANT_DB_NAME> USING BACKINT ('<BACKUP_PREFIX>')

Incremental Backups

Use the following syntax to perform backups for a Tenant database

BACKUP DATA INCREMENTAL FOR <TENANT_DB_NAME> USING BACKINT ('<BACKUP_PREFIX>')

Restore your database

Use the following syntax to perform a restore for a Tenant database to a specific point in time:

RECOVER DATABASE FOR <TENANT_DB_NAME> UNTIL TIMESTAMP 'YYYY-MM-DD HH:MM:SS' USING BACKINT CATALOG CHECK ACCESS USING BACKINT

or the following syntax to perform a restore from a specific backup_id:

RECOVER 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

The following example shows the syntax to recover your tenant database with a specific data backup without using a catalog.

RECOVER DATA FOR <TENANT_DB_NAME>  USING BACKINT ('<BACKUP_PREFIX>') 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.

RECOVER 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.

Recover example

RECOVER DATA FOR LKD USING SOURCE 'LKP@LKP' USING BACKUP_ID 0987654321 USING CATALOG BACKINT CLEAR LOG

Using 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