Friday, 26 February 2021

Backup and Recovery of SAP HANA Database on Azure using Azure Backup Plugin for HANA – Part II

This is in continuation of my previous blog post Backup and Recovery of SAP HANA Database on Azure using Azure Backup Plugin for HANA – Part I

3. CONFIGRUATIONS

3.1 Discovery of Databases

After running the pre-registration script, we need to go to the Azure portal → Recovery Service Vault → + Backup

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Then we need to go to SAP HANA in Azure VM → Start Discovery

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Azure Backup Service will try to discover the SAP HANA database on all the hosts associated in the region

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Then, need to select the hostname on which we need to configure the backup and then click on Discover DBs

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

An Azure deployment will get started which will register host to protected Container

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Below screen will appear when Deployment gets succeeded

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Same can be checked in Protected Servers in Recovery Service Vaults with the number of DBs that Azure found during discovery

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

3.2 Configure Backups

As the databases which needs to be backed up are discovered, now next step is to configure and enable the backup

Go to Recovery Service Vault and then click on Configure Backup

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Now, add the databases by clicking Add Resources for which backup needs to be executed

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Select the required databases on which backup needs to be done and Click OK

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Now, check the policy which will be applied to the backup and click on Enable Backup

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

This will start a deployment which is going to deploy backup service on the databases

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Deployment has been finished

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

3.3 Backup Policy
A backup policy defines when backups are taken, and how long they’re retained in vault for backup.

◉ A policy is created at the vault level.
◉ Multiple vaults can use the same backup policy, but backup policy must apply to each vault.

For setting up policy Go to Recovery Service Vault → Backup Policies, Click on Add:

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Click on SAP HANA in Azure VM

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Specify the Name of the Policy and specify the Full Backup Policy

In Full Backup policy, select a Backup Frequency, choose Daily or Weekly.

◉ Daily: Select the hour and time zone in which the backup job should begin.
     ◉ A full backup must be run. This option cannot be turned off.
     ◉ Select Full Backup to view the policy.
     ◉ Differential backups cannot be created for daily full backups.
◉ Weekly: Select the day of the week, hour, and time zone in which the backup job should runs.
◉ In Retention Range, configure retention settings for the full backup.
     ◉ By default, all options are selected. Clear any retention range limits that is not required and set those that are required.
     ◉ The minimum retention period for any type of backup (full/differential/log) is 7 days.
     ◉ Recovery points are tagged for retention based on their retention range. For example, if daily full backup is selected, only one full backup is triggered each day.
     ◉ The backup for a specific day is tagged and retained based on the weekly retention range and setting.

The monthly and yearly retention ranges behave in a similar way.

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

In Differential Backup policy, select Enable to open the frequency and retention controls.

◉ At most, one differential backup per day can be triggered.
◉ Differential backups can be retained for a maximum of 180 days. For longer retention, full backups must be use

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

In Incremental Backup policy, select Enable to open the frequency and retention controls.

◉ At most, one incremental backup per day can be triggered.
◉ Incremental backups can be retained for a maximum of 180 days. For longer retention, full backups can be used.

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Select Log Backup to add a transactional log backup policy,

◉ In Log Backup, select Enable. This can’t be disabled, since SAP HANA manages all log backups.
◉ Set the frequency and retention controls.
◉ Log backups only begin to flow after a successful full backup is complete

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

After Clicking Create, policy will be created and can be checked in Backup Policies

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

3.4 Performance Tuning

The backups (log and non-log) in SAP HANA Azure VMs provided via Backint are streams to Azure Recovery services vaults and so it is important to understand this streaming methodology.

3.4.1 Throughput Performance

The Backint component of HANA provides the ‘pipes’ (a pipe to read from and a pipe to write into), connected to underlying disks where database files reside, which are then read by the Azure Backup service and transported to Azure Recovery Services vault. The Azure Backup service also performs a checksum to validate the streams, in addition to the backint native validation checks. These validations will make sure that the data present in Azure Recovery Services vault is indeed reliable and recoverable.

The Azure Backup service attempts to achieve upto ~420 MBps for non-log backups (such as full, differential and incremental) and upto 100 MBps for log backups for HANA. These are not guaranteed speeds and depend on following factors:

◉ Max Uncached disk throughput of the VM
◉ Underlying disk type and its throughput
◉ The number of processes which are trying to read and write into the same disk at the same time.

3.4.2 Limiting Backup Throughput

In smaller VMs, where the uncached disk throughput is very close to or lesser than 400 MBps, it is concerned that the entire disk IOPS are consumed by the backup service which may affect SAP HANA’s operations related to read/write from the disks. In that case, it is possible to throttle or limit the backup service consumption to the maximum limit, using below steps:

Go to path /opt/msawb/bin and create a new file with name ExtensionSettingOverrides.json and add below key values to it

{
"MaxUsableVMThroughputInMBPS": 200
}

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Change the permissions and ownership of the file using following command:

chmod 750 ExtensionSettingsOverrides.json
chown root:msawb ExtensionSettingsOverrides.json

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

No restart of any service is required. The Azure Backup service will attempt to limit the throughput performance as mentioned in this file.

4. SAP HANA BACKUP


4.1 On-Demand Backup

Backups run in accordance with the policy schedule. On-demand backups can be run as follows:

Go to Recovery Service Vault and click on Backup Items: –

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Click on SAP HANA in Azure VM, as it has 2 backup items for the connected HANA Databases

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

As Initial backups is pending, hence select systemdb to initialize backup and click on Backup now

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Specify the type of backup and click OK

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

A notification will appear for triggering of the backup

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Full backup of HANA systemdb has been triggered

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Systemdb Backup job can be monitored in Backup jobs, as it shows backup is running

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

After 3 minutes, time is according to the size of the database, backup has been finished

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Backup of other tenant database can be triggered with same way by going to Backup Items

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

After successful completion of backup, we can check the same in Backup jobs

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

We can also check for the Full backups and Log backups traces in file /usr/sap/<sid>/HDB<nr>/<host>/trace/backint.log

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

And in file /usr/sap/<sid>/HDB<nr>/<host>/trace/backup.log

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

Log backups for point in time recovery can also be checking in Recovery Service Vault → Backup Item

SAP HANA Backup and Recovery, SAP HANA Database, SAP HANA Certification, SAP HANA Learning, SAP HANA Guides, SAP HANA Certification, SAP HANA Preparation, SAP HANA Prep

4.2 Backup from HANA Studio/Cockpit with Azure Backup Enabled

In case of taking local backup (using HANA Studio) of a database that’s being backed up with Azure Backup, below steps needs to be followed:
  • Wait for any full or log backups for the database to finish. Check the status in SAP HANA Studio / Cockpit.
  • Disable log backups and set the backup catalog to the file system for relevant database.
    • To do this, double-click systemdb → Configuration → Select Database → Filter (Log).
    • Set enable_auto_log_backup to No.
    • Set log_backup_using_backint to False.
    • Set catalog_backup_using_backint to False.
  • Take an on-demand full backup of the database.
  • Wait for the full backup and catalog backup to finish.
  • Revert the previous settings back to those for Azure:
    • Set enable_auto_log_backup to Yes.
    • Set log_backup_using_backint to True.
    • Set catalog_backup_using_backint to True.

No comments:

Post a Comment