Performing Data Backups

Objectives

After completing this lesson, you will be able to:

  • Perform a data backup

Performing Data Backups

Business Example

It is your task to understand the differences between the different data backup types SAP HANA supports, and implement a secure and cost efficient backup strategy for your company.

Types of Data Backups

The payload of the data area can be backed up by performing a complete data backup and/or delta backups. Delta backups contain all changed data since the last complete data backup.

Delta backups allow you to reduce the amount of data that is backed up, compared to complete data backups. In turn, this means that delta backups are faster to create than complete data backups.

The following two types of delta backups are available:

Differential
It stores all the data that changed since the last complete data backup.
The amount of data to be saved with each differential backup increases.
Incremental
It stores the data that changed since the last complete data backup or the last delta backup (incremental or differential).
If data remains unchanged, it is not saved to more than one backup. For this reason, incremental backups are the smallest of the backup types.

The type of delta backup to use depends on your specific backup and recovery requirements. You can also mix incremental and differential backups.

Note that, in terms of backup and recovery, "changed data" is related to the physical layout of the data in the SAP HANA persistent storage. This does not always correlate to the amount of data actually changed.

For example, a delta merge of a column store partition does not change the content of an SAP HANA database at all. However, it re-creates the whole partition for optimized read access of the data. In this case, the whole partition is backed-up in a delta data backup, even if no data is changed.

Data Backup Steps

When a data backup in a tenant is started, the following steps are performed:

  1. A backup savepoint of all services is created
  2. The data volume is backed up
  3. The topology file is written

When the data area is backed up, all the payload data from all the servers is backed up. This happens in both single-host and multi-host environments.

Naming Convention Backup Files

Each backup file name contains the following elements: <<path>/<prefix>_<string>_<suffix>>. These elements are described as follows:

  • The <path> is optional. If no complete path is specified, the default basepath_databackup location is used.

  • You can specify a <prefix> for the backup file name, or you can use the prefix proposed by the system. For example, use a <timestamp> or the <day of the week>.

  • The <string> is defined by the type of the data backup used. The system uses databackup, databackup_differential, or databackup_incremental, depending on the type of backup created.

  • The system adds a unique <suffix> in the form of <Volume ID>_<Index>.The <Volume ID> identifies the database service to which the backup belongs. For example, the name server. Volume ID is always 1. All database services get their <Volume ID> assigned during the installation procedure.

    Note
    For delta backups, the suffix also contains the Backup ID of the backup that the delta backup is based on.

Estimating the Size of a Data Backup

If there is not enough space available at the backup location, the backup will fail. For this reason, before you back up the database, estimating the size of the backup is a good practice.

Before the backup, the administrator can estimate size of the backup from the M_BACKUP_SIZE_ESTIMATIONS view by executing the SQL statement:

Code snippet
select * from M_BACKUP_SIZE_ESTIMATIONS
Expand
The output is a, per database service, estimated size list in bytes. It is therefore recommended to keep some additional free space in reserve.

Performing Manual Backups

The SYSTEMDB is used for central system administration tasks, and contains technical information about the whole SAP HANA database system. The tenants contain all the business data. Using SAP HANA cockpit or SQL, you can create complete data and delta backups. Create regular backups of the SYSTEMDB and all the tenants.

There are two possible scenarios to perform the regular backups, as follows:

  • Scenario 1: All backups are centrally performed by the SYSTEMDB administrator. The central scheduler in the SYSTEMDB allows to centrally plan backups for the SYSTEMDB and all tenants. The SYSTEMDB administrator has insight in the whole backup schedule and so avoiding contention on the backup server.

    In this scenario, the database administrator can use the restricted features application to restrict to block the backup functionality within a tenant.

  • Scenario 2: All the tenant administrators individually perform their tenant backups. Tenant administrators can use the tenant scheduler to individually plan their tenant backups. The tenant administrator has no insight in when the other administrators plan their tenant backups, this could lead to contention on the backup server.

Manually Creating Backups using SAP HANA Cockpit

Using SAP HANA cockpit, from the SYSTEMDB, you can manually make separate backups of the SYSTEMDB and all the tenant databases. Navigate to the Database Management application using the following steps:

  1. Log on to SAP HANA cockpit.
  2. On the Home screen, select the Database Directory tile.
  3. On the Database Directory screen, select the Database Management link of the SYSTEMDB that you want to use for the backups.
  4. On the Database Management screen, under the backup column, select the No backup link of the database you want to back up.
  5. On the Backup Catalog screen, select the Create Backup to open the Create Backup wizard.

In the Create Backup wizard, you can choose the backup type (complete, differential, or incremental), the backup destination, backup compression, retain backup, and to include the configuration files. Which backup settings you need depends on your backup strategy. The default settings are fine to perform the initial backup after installation. Choose the Back Up button to start the backup.

While the backup is running, the Create Backup wizard displays a progress bar. Depending on the size of the backup and the throughput to the backup location, this can take some time. There is no need to keep the Backup Progress open – choose the Run in Background to let the backup can finished in the background.

Note
You can cancel a running data backup from the progress details screen.

Backup Catalog Details

As soon as the backup is finished, the backup catalog is updated, and backup details can be displayed.

Log in to track your progress & complete quizzes