Skip to main content
Pure Technical Services

Protecting SAP HANA with VERITAS Netbackup

SAP HANA can be protected by VERITAS Netbackup as it is a certified third party tool for the Backint for SAP HANA Interface. More information on Working with Third-Party Backup Tools can be found in the SAP HANA Administration Guide for SAP HANA Platform.

This knowledge article will highlight the configuration steps to integrate SAP HANA and VERITAS Netbackup to create and recover from data backups made using Backint. 

Prerequisites 

The following prerequisites need to be in place before any further configuration can occur :

  • A VERITAS Netbackup Master server is installed and fully licensed.
  • The VERITAS Netbackup Client for RHEL or SLES has been installed on all SAP HANA systems in the landscape. The clients are also fully registered and there are no communication issues between the client and master servers.
  • (Optional) A media server is installed and configured with either AdvancedDisk or Media Server Deduplication Pool (MSDP) using NFS shares from a FlashBlade. 
  • SAP HANA is installed and running on either a Scale Up on or Scale Out instance. 
  • The Maximum jobs per client value in the Global Attributes of the Netbackup Master server is set to the amount of expected jobs per SAP HANA database.
  • Access to the client has been allowed by adding the media server to the Clients Properties under Servers->Media Servers.

 Create a Policy for the SAP HANA Backup and Recovery Operations

A single policy can be used for a range of systems or a policy can be created for each individual tenant including the SystemDB. 

Under "Netbackup Management" locate "Policies"  and under "All Policies" right-click to bring up the context menu and then select "New Policy".

clipboard_e68c78a7749c74bca69a6c3c5ac43a762.png

Give the new policy a name and select "Use Policy Configuration Wizard".

clipboard_ec0dac7e8740895bef505247715bf33db.png

Create a backup policy for "File systems, databases, applications".

clipboard_e09299d30c10df873223f8f033f433a32.png

Select a Policy Type of "SAP".

clipboard_ef4a660b3859711797bf495c87c8a8af6.png

In the client list, all systems which need to have access to this policy should be added. In a Scale Up landscape this could be individual instances with no relation to one another using the same policy, or systems being used as a part of a storage or system replication group. In a Scale Out landscape all of the nodes must be added to the policy.

If using ActiveCluster and want to incorporate host failover into the failover domain , the second host (Scale Up)  or host group(Scale Out) must be added to the client list for the same policy as the first.

Scale Up Landscape:

clipboard_e33a4af0c03626fc43ad864b6d7df08e9.png

Scale Out Landscape:

clipboard_e018463fd842447f89687560728bbd52d.png

Set the Backup Type to be "Full Backup".

clipboard_e0d0e3a8b62f3ff36cf0d7c8b5e6a2b2b.png

Set the Frequency and Retention Schedules.

clipboard_e43a0a1290e382f69d420f1a3cfc83251.png

Set the schedule windows. 

clipboard_e90ae6569ca50d7ef710587017244e7de.png

The backup policy has now been created. To set the FlashBlade NFS stores used for AdvancedDisk or MSDP as the storage unit for this policy right click on the policy to bring up the context menu and select "Change". 

clipboard_e2d2d697bf80e9253f62284465e41f7ea.png

In this policy, the policy storage has been set to "FB-Dedupe-Pool-stu".

clipboard_e176a3e08c822c923e04869dee5c4db13.png

In the Schedules view note the name of the Schedules. SAP HANA will use the default "Default-Application-Backup" unless otherwise specified. 

clipboard_ee87f340019809623b9973d37f5c3eb9d.png

It is important to note that for the storage unit, if parallel data streaming from Backint is going to be used, then the Storage Unit must be capable of and have the Maximum concurrent jobs set to match the parallel value. 

Each tenant in a system using multiple database contains (MDC) will use the parallel streams set for the system if the database size is above 128GB. A 4 tenant system set to use 8 streams in the backint configuration will then use 32 streams if all of the tenants are being backed up at once. 

clipboard_ebb9e498d77c6d118e4a5a76eadfb4031.png

SAP HANA Scale Up Configuration 

Data Flow Architecture for SAP HANA Scale Up Backup to FlashBlade NFS
Netbackup_ScaleUp.jpg

Step 1. Create the SAP HANA backint soft link

  • The Netbackup "hdbbackint" file location is typically /usr/openv/netbackup/bin/hdbbackint.
    • The hdbbackint_script can also be used instead of the hdbbackint file. 
  • The soft link needs to be created to /usr/sap/$SAPSYSTEMNAME/SYS/global/hdb/opt/.
    • In some versions of SAP HANA the "opt" directory will need to be created before creating the soft link.

To create the soft link execute the following:

ln -s /usr/openv/netbackup/bin/hdbbackint_script /usr/sap/$SAPSYSTEMNAME/SYS/global/hdb/opt/hdbbackint

If multiple systems will need access to the backups created by this single instance then a node_names.txt file must be created. To do this create a file "/usr/openv/netbackup/ext/db_ext/sap/node_names.txt" and then add the client names to this file that netbackup would expect. This file needs to match the names of the clients added to the policy. 

Check the CLIENT_NAME parameter in /usr/openv/netbackup/bp.conf for each node, this is the name which needs to be added to node_names.txt:

SERVER = nbu-sap.puredoes.local
CLIENT_NAME = rhana01.puredoes.local
CONNECT_OPTIONS = localhost 1 0 2

Example - 2 systems will need access to these backups, system1.domain.local and system2.domain.local. If netbackup is aware of the clients using fully qualified domain names then the node_names.txt file will look like this :

system1.domain.local
system2.domain.local

If the master server is only aware of the clients using hostnames then the node_names.txt file will look like this :

system1
system2

Step 2. Create a Configuration File for SAP HANA to Use for backint Operations 

If using multiple policies for each tenant then multiple copies of the configuration need to be made and customized to accommodate the backup strategy. 

In the directory /usr/openv/netbackup/ext/db_ext/sap/scripts/sap_oracle on the SAP HANA Scale Up system there are a number of files:

-r-xr-xr-x 1 root bin  1194 Jun 25  2019 bplist_filter
-r-xr-xr-x 1 root bin  6865 Jun 25  2019 initSAP.sap
-r-xr-xr-x 1 root bin 15197 Jun 25  2019 initSAP.utl
-r-xr-xr-x 1 root bin  1195 Jun 25  2019 restore_filter
-r-xr-xr-x 1 root bin  1055 Jun 25  2019 sap_custom_sort_file
-r-xr-xr-x 1 root bin  1792 Jun 25  2019 sap_offline_backup
-r-xr-xr-x 1 root bin  3743 Jun 25  2019 sap_online_backup
-r-xr-xr-x 1 root bin  2554 Jun 25  2019 sap_redo_log_backup
-r-xr-xr-x 1 root bin  2349 Jun 25  2019 sap_rman_backup

Copy the "initSAP.utl" file and give it a new name. 

In the new file the minimum requirement is that the policy name and schedule to be used are set, the policy name setup in the pre-requisites (create a policy for the SAP HANA backup and recovery operations) should be used here:

# policy: is an optionl parameter and should be set to the name of a SAP policy
# type that has been defined in Netbackup.  The SAP policy must have a schedule
# type of Application Backup defined in order for BACKINT to work.  If BACKINT finds
# a $SAP_POLICY environment variable, the policy parameter value will be
# overriden by the value of the $SAP_POLICY variable.  If the policy parameter
# is not specified and there is no environment variable, then BACKINT will
# exit with an error.
#
policy sap-hana-backup
#
#
# schedule: Is optional and must be set to the name of type  Application Backup
# schedule that is associates with a SAP policy type.  The schedule can
# define aspects of the backup such as how long Netbackup retains images,
# maximum MPX per drive, storage unit, and volume pool.  If BACKINT finds a
# $SAP_SCHED environment variable, the schedule parameter value will be
# overriden by the value of the $SAP_SCHED environment variable.  If the
# schedule parameter is not specified and there is no environment variable,
# then, NetBackup uses the first schedule of type Application Backup
# that it finds. It is higly recommended to set schedule parameter in *.utl file.
#
schedule Default-Application-Backup         

Step 3. Set the Parameter File Configuration for SAP HANA Backint

Using SAP HANA studio, connected to either the SystemDB or individual tenants, navigate to Configuration -> global.ini -> backup and set the values for the following fields:

Field Value 
catalog_backup_parameter_file File system location of the file setup for the tenant or database in Step 2.
catalog_bakup_using_backint true
data_backup_parameter_file File system location of the file setup for the tenant or database in Step 2.
log_backup_parameter_file File system location of the file setup for the tenant or database in Step 2.
log_backup_using_backint true
paralell_data_backup_backint_channels Set to a value (up to 32) to which each tenant/database should run parallel data streaming operations through backint. Each stream in Backint will translate to a data stream to the FlashBlade.

Any values set for the System will then be applied to any tenants by default. To override this value set any specific values for each tenant. 

clipboard_e1e75c8be14f3d56792cbd3383b69f2e1.png

SAP HANA Scale Out Configuration 

Within an SAP HANA Scale Out Landscape when running backups through backint every worker node opens a data path to the Media Server.  

Data Flow Architecture for SAP HANA Scale Out Backup to FlashBlade NFS
Netbackup_FB_HANA_SO.jpg

Step 1. Create the SAP HANA backint Soft Link

In a Scale Out landscape it is possible for any node to be a worker at any point in time. This requires that each node is able to access any backup images which have been created by another node. To inform the Netbackup configuration that images created by one node may need to be accessed by another node, a node_names.txt needs to be created. 

  • Create the file "node_names.txt" in "/usr/openv/netbackup/ext/db_ext/sap/" and place the hostname of all of the nodes in it:
    • echo "`hostname -f`" >> /usr/openv/netbackup/ext/db_ext/sap/node_names.txt
    • Copy this file to each node in the landscape (both worker and standby).

If Netbackup is aware of the clients using the fully qualified domain names, then the hostname may need the domain name added to each entry.

Check the CLIENT_NAME parameter in /usr/openv/netbackup/bp.conf for each node, this is the name which needs to be added to node_names.txt:

SERVER = nbu-sap.puredoes.local
CLIENT_NAME = rhana01.puredoes.local
CONNECT_OPTIONS = localhost 1 0 2

The node_names.txt file should be similar to the below: 

rHANA01.puredoes.local
rHANA02.puredoes.local
rHANA03.puredoes.local
rHANA04.puredoes.local 
  • Identify the node on which the master nameserver is running:
    • Logged in as the <sid>adm user execute the python script "landscapeHostConfiguration.py".
      • Located in /usr/sap/<sid>/HDB<instance_number>/exe/python_support
python /usr/sap/RH1/HDB00/exe/python_support/landscapeHostConfiguration.py

The following table will be returned: note the column for NameServer Actual Role and which host is marked as "master". 

| Host    | Host   | Host   | Failover | Remove | Storage   | Storage   | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host   | Host   | Worker  | Worker  |
|         | Active | Status | Status   | Status | Config    | Actual    | Config   | Actual   | Config     | Actual     | Config      | Actual      | Config | Actual | Config  | Actual  |
|         |        |        |          |        | Partition | Partition | Group    | Group    | Role       | Role       | Role        | Role        | Roles  | Roles  | Groups  | Groups  |
| ------- | ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------ | ------ | ------- | ------- |
| rhana01 | yes    | ok     |          |        |         1 |         1 | default  | default  | master 1   | master     | worker      | master      | worker | worker | default | default |
| rhana02 | yes    | ok     |          |        |         2 |         2 | default  | default  | master 2   | slave      | worker      | slave       | worker | worker | default | default |
| rhana03 | yes    | ok     |          |        |         3 |         3 | default  | default  | master 3   | slave      | worker      | slave       | worker | worker | default | default |
| rhana04 | yes    | ok     |          |        |         4 |         4 | default  | default  | slave      | slave      | worker      | slave       | worker | worker | default | default |

overall host status: ok

On the NamServer master host - create the soft link:

  • The Netbackup "hdbbackint_script" file location is typically /usr/openv/netbackup/bin/hdbbackint_script.
  • The soft link needs to be created to /usr/sap/$SAPSYSTEMNAME/SYS/global/hdb/opt/.
    • In some versions of SAP HANA the "opt" directory will need to be created before creating the soft link.

To create the soft link execute the following:

ln -s /usr/openv/netbackup/bin/hdbbackint_script /usr/sap/$SAPSYSTEMNAME/SYS/global/hdb/opt/hdbbackint

Step 2. Create a Configuration File for SAP HANA to Use for backint Operations 

if using multiple policies for each tenant then multiple copies of the configuration need to be made and customized to accommodate the backup strategy. 

In the directory /usr/openv/netbackup/ext/db_ext/sap/scripts/sap_oracle on the SAP HANA Scale Up system there are a number of files:

-r-xr-xr-x 1 root bin  1194 Jun 25  2019 bplist_filter
-r-xr-xr-x 1 root bin  6865 Jun 25  2019 initSAP.sap
-r-xr-xr-x 1 root bin 15197 Jun 25  2019 initSAP.utl
-r-xr-xr-x 1 root bin  1195 Jun 25  2019 restore_filter
-r-xr-xr-x 1 root bin  1055 Jun 25  2019 sap_custom_sort_file
-r-xr-xr-x 1 root bin  1792 Jun 25  2019 sap_offline_backup
-r-xr-xr-x 1 root bin  3743 Jun 25  2019 sap_online_backup
-r-xr-xr-x 1 root bin  2554 Jun 25  2019 sap_redo_log_backup
-r-xr-xr-x 1 root bin  2349 Jun 25  2019 sap_rman_backup

Copy the "initSAP.utl" file and give it a new name. 

In the new file the minimum requirement is that the policy name and schedule to be used are set, the policy name setup in the pre-requisites (Create a policy for the SAP HANA backup and recovery operations) should be used here:

# policy: is an optionl parameter and should be set to the name of a SAP policy
# type that has been defined in Netbackup.  The SAP policy must have a schedule
# type of Application Backup defined in order for BACKINT to work.  If BACKINT finds
# a $SAP_POLICY environment variable, the policy parameter value will be
# overriden by the value of the $SAP_POLICY variable.  If the policy parameter
# is not specified and there is no environment variable, then BACKINT will
# exit with an error.
#
policy sap-hana-backup
#
#
# schedule: Is optional and must be set to the name of type  Application Backup
# schedule that is associates with a SAP policy type.  The schedule can
# define aspects of the backup such as how long Netbackup retains images,
# maximum MPX per drive, storage unit, and volume pool.  If BACKINT finds a
# $SAP_SCHED environment variable, the schedule parameter value will be
# overriden by the value of the $SAP_SCHED environment variable.  If the
# schedule parameter is not specified and there is no environment variable,
# then, NetBackup uses the first schedule of type Application Backup
# that it finds. It is higly recommended to set schedule parameter in *.utl file.
#
schedule Default-Application-Backup         

Copy the new configuration file(s) to the same location on each host in the Scale Out Landscape. 

Step 3. Set the Parameter File configuration for SAP HANA Backint.

Using SAP HANA studio, connected to either the SystemDB or individual tenants, navigate to Configuration -> global.ini -> backup and set the values for the following fields:

Field Value 
catalog_backup_parameter_file File system location of the file setup for the tenant or database in Step 2.
catalog_bakup_using_backint true
data_backup_parameter_file File system location of the file setup for the tenant or database in Step 2.
log_backup_parameter_file File system location of the file setup for the tenant or database in Step 2.
log_backup_using_backint true
paralell_data_backup_backint_channels

Set to a value (up to 32) to which each tenant/database should run parallel data streaming operations through backint. Each stream in Backint will translate to a data stream to the FlashBlade.

This value will be applied on a per host basis. If 16 parallel data backup channels are set in a 4 worker nodes environment , then the number of concurrent streams will be 32. 

Any values set for the System will then be applied to any tenants by default. To override this value set any specific values for each tenant. 

It is possible to have the configuration file in a different location on each host and then to set this value on a per-host basis. The best practice would be to have this file located on the SAP HANA shared filesystem and all of the nodes to reference the same location.

clipboard_e76d12ff7c2fa79af0dea6e505059e602.png

Running Backups for SAP HANA System and Tenant Databases

There are a number of ways to run backups for the SAP HANA system.

Create a Shell Script for Netbackup to Call when Running a Backup 

The script will need to either be located in an authorized location , or the location it is being held needs to be registered as an authorized location. More information can be found in the VERITAS support article Registering authorized locations used by a Netbackup database script based policy.

Example shell script to backup the SAP HANA SystemDB: 

#!/bin/sh
DATE_TIME="`date \"+%Y%m%d_%H_%M_%S\"`"
BACKUP_PREFIX="COMPLETE_DATA_BACKUP"
BACKUP_PREFIX="$BACKUP_PREFIX"_"$DATE_TIME"
/usr/sap/SH1/HDB00/exe/hdbsql -i 0 -d SYSTEMDB -u SYSTEM -p Osmium76 "BACKUP DATA for SYSTEMDB using backint ('$BACKUP_PREFIX')" ​​​​

In the change policy view, go to Backup Selections and add a new Script to execute. Multiple scripts can be added to this list. 

clipboard_efde99f25b4cfbead1fc7c4123e7d67e9.png

To execute the backup, either wait for the schedule to execute or right-click on the policy and select "Manual Backup". Select the clients and schedule to use. 

clipboard_e2f1934a79dd7f73ccbf33c137dddb743.png

Execute a Backup Using HDBSQL

Executing the following HDBSQL command for a database (either tenant or SystemDB) will trigger a backup being run:

BACKUP DATA for <Database_name> using backint ('BACKUP_PREFIX')

Execute a Backup Using SAP HANA Studio 

 See the SAP HANA Administration Guide: Reference: Backup Console for details on how to create a backint backup. 

Execute a Backup Using SAP HANA Cockpit 

SAP HANA Cockpit can be used to schedule and create manual backint backups. More information on using SAP HANA Cockpit can be found in SAP HANA Administration with SAP HANA Cockpit : Backup and Recovery.