How to use more than one policy or schedule to get different storage or retention when backing up SAP HANA?

Article: 100012565
Last Published: 2024-11-18
Ratings: 2 0
Product(s): NetBackup

Problem

When configuring a SAP HANA client, the initSAP.utl file has only one 'policy' parameter and one 'schedule' parameter.
This seems to limit the configurability with regard to having multiple storage unit or retention levels associated with the backups.

With NetBackup for SAP Oracle, the SAP_POLICY and SAP_SCHED environment variables can be used to override the 'policy' parameter in the initSAP.utl file.  With NetBackup for SAP HANA these environment variables are ignored. 

How can can NetBackup for SAP HANA be configured to allow the use of different storage units or retentions?
 

Cause

The SAP_POLICY and SAP_SCHED environment variables can be used by NetBackup for SAP Oracle because the NetBackup for SAP agent (backint) is a child of the backup script wherein the variables are set.   Specifically, the backup script starts the SAP brbackup or brarchive program which inherits the variables, which in turn starts backint which inherits and uses the variables.

Conversely, for SAP HANA, the backup script starts the hdbsql program which connects to the instance on the master node.  The instance then starts the backint program.  Because the instance is not a child process of the backup script, it does not inherit the environment variables and cannot make them available to backint.

This restriction is similar to using SAP RMAN and recent versions of SAP MaxDB.
 

Solution

Separating database from log backups

If the goal is to use a different storage unit or retention for the database backups compared to the log backups, then configure as follows.

  1. Add a second schedule of type 'application backup' to the SAP policy.
  2. Set the storage unit and retention on one of the schedules as appropriate for the database backup.
  3. Set the storage unit and retention on the other schedule as appropriate for the log backup.
  4. Create two initSAP.utl files, one with 'schedule' parameter set to the name to use for the database backup, one with 'schedule' parameter set to the name to use for the log backup.
  5. Place the two initSAP.utl files into a directory on a shared volume that can be accessed by all of the SAP HANA nodes.
  6. In the SAP HANA Studio: double-click the instance name, select the Configuration tab, expand global.ini, expand backup.
  7. Set data_backup_parameter_file to the absolute pathname for the appropriate initSAP.utl file.
  8. Set log_backup_parameter_file to the absolute pathname for the appropriate initSAP.utl file.

Note: This could also be accomplished using two policies instead of two application schedules within the same policy.

Separating Monthly, Weekly, Daily and Log backups

If there is a need to use more than two storage units or retentions, then a minor addition to the HANA backup script can allow the use of a different initSAP.utl for each type of backup.   This example uses one policy to perform four types of backups.
 

  1. Create an SAP policy with three automatic schedules;  Monthly, Weekly, Daily.
  2. Set the storage unit and retention on the Default-Application-Backup schedule as appropriate for the log backup.
  3. Create three application backup schedules and set the storage unit and retention appropriately for each; Monthly-App, Weekly-App, Daily-App.
  4. Create four initSAP.utl files, with appropriate schedule parameters, in a directory shared by all of the SAP HANA nodes; initMonthly.utl, initWeekly.utl, initDaily.utl, initLOG.utl.
  5. Copy initDaily.utl to initSAP.utl as a starting point for the first backup.
  6. Per above procedure, configure SAP HANA Studio to use the initSAP.utl file for the data_backup_parameter_file.
  7. Similarly, configure initLOG.utl for the log_backup_parameter_file.
  8. Craft the backup script to determine which automatic schedule was used to execute the script, and then replace initSID.utl with the appropriate initMonthly.utl, initWeekly.utl, or initDaily.utl before starting hdbsql.

if [ "$SAP_SNC_SCHED" = "Monthly" ]; then
     cp /<shared_path>/initMonthly.utl /<shared_path>/initSAP.utl
elif [ "$SAP_SNC_SCHED" = "Weekly" ]; then
     cp /<shared_path>/initWeekly.utl /<shared_path>/initSAP.utl
else
     cp /<shared_path>/initDaily.utl /<shared_path>/initSAP.utl
fi

/path/to/hdbsql <options>

Note:  If the log backup should use the same storage unit and retention as the database backup, do not create initLOG.utl and set log_backup_parameter_file to the pathname to initSID.utl.

Note: If using multiple policies, compare the policy name to the $SAP_POLICY variable, instead of to $SAP_SNC_SCHED.
 

 

Applies To

NetBackup 8.x - 10.x for SAP HANA
 

Was this content helpful?