Prepare SAP HANA databases for backup

Prerequisites

  • All the configured services—see SAP Note 1697613 and SAP Note 1649519— such as nameserver, indexserver, etc. must be running. You can check this in the Overview of SAP HANA studio > Operational State > Confirm all services are started.

  • To allow the Backup and DR agent to perform host-side operations, use a SAP HANA hdbuserstore key instead of a username and password to communicate with HANA database using the SAP HANA secure userstore. See Configure the HANA userstore key.

  • Database log_mode must be set to normal under the HANA Studio configuration tab. See Set up the log mode and log backup in HANA Studio.

  • All SAP HANA servers that have data to be protected by Backup and DR must have the Backup and DR agent installed.

  • If the underlying data volumes for SAP HANA are protected as SAP HANA DB backups using LVM snapshot with CBT or file-based backup integrated with backint, and if you are also protecting file systems on the same host, in the file system app, you should set /hana/log & /hana/data in an exclude path. See Linux file system.

Configure the HANA userstore key

Use the following instructions to configure the HANA userstore key:

  1. Create the database backup user from HANA Studio.

  2. Get the instance and SQL port numbers.

  3. Create the SAP HANA hdbuserstore key for system DB backup users.

Step 1: Create the database backup user from HANA Studio

Choose a database user name based on the company's standard. Make sure to create this user account under SYSTEMDB.

  1. Create the user under SYSTEMDB

    • From SAP HANA Studio SYSTEMDB, go to System > Security > Users > New User.

    • Assign a username and a password.

    • Set Force password change on next logon to No.

    • HANA 1.0: Click on the System privilege tab and assign privileges by selecting the following:

      • Backup admin
      • Catalog read
      • Database admin
    • HANA 2.0 (SPS01 to SPS04): Click on the System privilege tab and assign privileges by selecting the following:

      • Backup admin
      • Catalog read
      • Database admin
      • Database start
      • Database stop
    • HANA 2.0 (SPS05): Click on the System privilege tab and assign privileges by selecting the following:

      • Backup admin
      • Catalog read
      • Database backup operator
      • Database recovery operator
      • Database admin
      • Database start
      • Database stop
  2. Deploy the newly created system user by clicking the green arrow.

Step 2: Get the instance and SQL port numbers

You need the HANA instance and SQL Port numbers for both system DBs.

HANA 1.0

The following instructions describe how to get the instance and SQL port numbers from a HANA 1.0 single container system:

  1. Go to System.

  2. Click the Landscape tab.

  3. Get the value of SQL port for indexserver.

HANA 2.0

The following instructions describe how to get the instance and SQL port numbers from HANA 2.0:

  1. Go to System.

  2. Click the Landscape tab.

  3. Click the Services tab.

  4. Under the Service column, navigate to the nameserver.

  5. Get the value of SQL port. The instance number are the second and third digits of the SQL port number.

Step 3: Create the SAP HANA hdbuserstore key for system DB backup users

Backup and DR recommends to use this naming convention for the userstore key name: For SYSTEMDB, set the key name (Database backup username) For example: Database backup username (Actbackup) Set SYSTEMDB—key_name— (ACTBACKUP)

Procedure for single node HANA system

  1. Connect to the HANA database system via SSH and login to (sid)adm: su - (sid)adm

  2. Change directory: cd exe

  3. Create entries in hdbuserstore using command hdbuserstore:

    ./hdbuserstore SET (key_name) (server):(port) (DB_user_name) (DB_user_password)
    

    In the case above:

    ./hdbuserstore SET ACTBACKUP s4hana:30013 ACTBACKUP (DB_user_password)
    
  4. Check the keystore: ./hdbuserstore list

Set up the log mode and log backup in HANA Studio

Using the HANA Studio set the HANA log mode and log backup location for Backup and DR to take backups of HANA DB transaction logs:

  1. In SAP HANA HDB studio, make sure log backup is set correctly under DATABASE (SYSTEMDB FOR HANA 2.0) > Backup > Configuration page:

    • Destination type is File.

    • Destination is set to a local file system mount path.

    • Backup interval is set to required RPO.

    • Automatic log backup is enabled.

  2. Check under Database configuration: DATABASE (SYSTEMDB FOR HANA 2.0) > Configuration page. In the filter, type basepath.

  3. Verify that basepath_logbackup is set correctly:

    • Set the basepath_catalogbackup to the same as basepath_logbackup.

    • Open the basepath_catalogbackup edit page.

    • Set the New value to the same as basepath_logbackup and click Save. This ensures the backup of the catalog with log backup for point in time recovery.

Install the Backup/DR agent (connector) on SAP HANA Servers

The Backup/DR agent, a small-footprint, lightweight service on the SAP HANA server, is used to capture an application-consistent copy of SAP HANA databases. It uses changed block tracking to identify changes to database data for Backup and DR's incremental forever capture strategy. All SAP HANA servers that have data to be protected by Backup and DR must have the Backup/DR agent installed.

  1. Download the agent installer file as detailed in Obtain the right Backup and DR agent for your host

  2. Log on to the Linux server as root.

  3. Install the agent as detailed in Install the Backup and DR Agent on a Linux host

Manage SAP HANA backups and recoveries

Change the disk mapping preference for a host from the management console

Use the following instructions to change a host's disk mapping preference:

  1. From the management console, click Manage and go to the Hosts tab.

  2. Right-click the host and select Edit.

  3. On the Edit host page, select the disk preference:

    • For block-based (mapping staging disk using iSCSI) backup with CBT, select Block.

    • For mapping staging disk as a NFS share: select NFS. Use NFS only with Backint backups.

  4. Select Save at the bottom of the Edit host page.

Configure Application details & settings for SAP HANA backup jobs

Setting Backup capture method: Volume-level backup Backup capture method: Full+Incremental backup
HANA DB user store key This is the SAP HANA hdbuserstore key for the system database created earlier. This field is mandatory. This is the SAP HANA hdbuserstore key for the system database created earlier. This field is mandatory.
Use staging disk granularity as minimum staging disk size For applications that are under the size of granularity setting that tend to periodically grow this new option is useful to avoid frequent costly FULL backups. Because the staging disk is thin provisioned, there is no initial cost to use a staging disk that is larger than required for immediate use. The values are 0 for No and the Staging disk granularity setting for Yes. For applications that are under the size of granularity setting that tend to periodically grow this new option is useful to avoid frequent costly FULL backups. Because the staging disk is thin provisioned, there is no initial cost to use a staging disk that is larger than required for immediate use. The values are 0 for No and the Staging disk granularity setting for Yes.
Staging disk granularity Maximum size of each staging disk when multiple staging disks are used for an application. The default value is 1000GB. Maximum size of each staging disk when multiple staging disks are used for an application. The default value is 1000GB.
Last staging disk minimum size Minimum size of the last staging disk created for an application with multiple staging disks. This value is also used for additional disks allocated to accommodate growth. The default value is 250GB. Minimum size of the last staging disk created for an application with multiple staging disks. This value is also used for additional disks allocated to accommodate growth. The default value is 250GB.
Backup and DR agent options Use this only under the guidance of support. Use this only under the guidance of support.
Percentage of reserve space in volume group This is for LVM snapshot temporary space. Recommended value is 20%. Not applicable
Backup capture method Use volume-level backup Use Full+Incremental backup
Use BACKINT for HANA Full+Incremental file system backup Not applicable When set to Yes, database backup uses the BACKINT configuration and BACKINT parameters are updated in the HANA database configuration files.
Force full filesystem backup Not applicable Use for an on-demand full backup
Ignore partial database backup failures Not applicable With this set to yes, the backup job continues even if one of the tenant backups fails.
Database filesystem staging disk size in GB Not applicable Use the default calculation: (database size * 1.5)+ 10%. The disks grow dynamically.
Log backup staging disk size in GB By default Backup and DR calculates this as daily log generation * retention of log backup plan plus 20% buffer. Default is recommended. Providing a value overrides the default calculation and the log disk does not grow dynamically. This becomes a fixed size. By default Backup and DR calculates this as daily log generation * retention of log backup plan plus 20% buffer. Default is recommended. Providing a value overrides the default calculation and the log disk does not grow dynamically. This becomes a fixed size.
Retention of production DB logs in hours Production log backups are deleted based on the number of hours passed. Default value is 2. Production log backups are deleted based on the number of hours passed. Default value is 2.
Retention of production catalog in days Retention of catalog logs in days. Retention of catalog logs in days.
Tenant DB user store key prefix HANA user store key prefix to backup tenant database. During the backup, Tenant database name is appended to the string provided. For example, if Prefix is provided as ACTBACKUP and tenant name is CL5, then userstore key for tenant is ACTBACKUPCL5. HANA user store key prefix to backup tenant database. During the backup Tenant database name is appended to the string provided. For example, if Prefix is provided as ACTBACKUP and tenant name is CL5, then userstore key for tenant is ACTBACKUPCL5.
Use SystemDB user store key to backup tenant SYSTEMDB userstore key is used to backup all the tenant databases. SYSTEMDB userstore key is used to backup all the tenant databases.
Run tenant backups in parallel Not applicable. If set to Yes, all tenant databases is backed up in parallel for backups using filesystem, non-backint.
Script timeout This value is applied to internal backup and recovery scripts called by Backup and DR agent. Default value is recommended. This value is applied to internal backup and recovery scripts called by Backup and DR agent. Default value is recommended.
Use buffered block copy Use this only under the guidance of support. Not valid for NFS. Use this only under the guidance of support. Not valid for NFS.

The Backup and DR SAP HANA DBA guide

This page is one in a series of pages specific to protecting and recovering SAP HANA databases with Backup and DR. You can find additional information in the following pages: