Backing up SAP HANA Databases with the Datto Linux Agent: Best-Practices

Topic

This article describes best-practices for backing up SAP HANA databases.

Environment

  • Datto SIRIS
  • Datto ALTO
  • Datto Linux Agent

Description

What is SAP HANA?

SAP HANA is an in-memory database and application platform. Its primary function as database server is to store and retrieve data as requested by the applications. In addition, it performs advanced analytics (predictive analytics, spatial data processing, text analytics, text search, streaming analytics, graph data processing) and includes ETL capabilities as well as an application server (source).

For more information regarding SAP HANA, see SAP's SAP HANA Backup/Recovery Overview.

On-premise SAP HANA databases are supported by Red Hat Enterprise Linux and SUSE Linux distributions.

What backup methods are recommended for SAP HANA?

SAP HANA has three overarching backup mechanisms available:

Data Backup to File

These backups allow creation of a database backup that is copied to another location. The files created allow manual restoration of the backup to that point in time.

  • Datto support for this database backup method would be to utilize a Share created on a SIRIS device. This share should be mounted on the SAP HANA server, and backups should be configured to write to this share as their destination.
  • Recovery would require rebuilding the server and manually importing the database export from a file restore.

Data Backup Using Backint

Backint is an API provided by SAP HANA to allow third party tools to invoke SAP HANA backups directly. This creates a backup of the database itself, but not the underlying file system. Datto has no integration with this API, and thus it is not supported.

Data Snapshot

Data Snapshots work by capturing the state of the SAP HANA database at the point in time that the snapshot was started. The internal database snapshot ensures that the state of the data snapshot is consistent.

  • Snapshots can be taken using the SQL commands specified in the SAP HANA Documentation: Create a Data Snapshot (Native SQL).
  • The process to restore back from a Data Snapshot can also be found in SAP HANA documentations: Recover SAP HANA From a Data Snapshot.
  • Datto does not directly integrate with SAP HANA snapshots. However, if a Datto Linux Agent (DLA) volume snapshot is initiated at a time when a SAP HANA Data Snapshot is taken, block-level backups of the disk will include the state of the consistent SAP HANA snapshot on disk. DLA can only provide guarantees on the snapshot of the underlying volume, but not whether a SAP HANA snapshot is recoverable or valid.

You can view an overview table of these backup options in SAP HANA documentation here: SAP HANA Backup Comparison.

How to use SAP HANA Data Backup to File with Datto File Shares

  1. Create a NAS share or iSCSI volume on your SIRIS device as detailed in the article Creating and Protecting Network Shares With a Datto Appliance.
  2. Mount this file share using your preferred protocol to a location on the SAP HANA System. See Configure Share Settings for available protocol configuration options.
  3. Use the steps provided by SAP HANA to schedule a backup to the mounted file share location: Scheduling SAP HANA Backups to File.

How to invoke SAP HANA Data Snapshots when using Datto Linux Agent

To ensure backup consistency, Datto Linux Agent (DLA) should be used in conjunction with SAP HANA Data Snapshots. DLA performs backups by taking a block-level snapshot of the underlying file systems. On Linux, block-level snapshots are not application-aware.

To work around this constraint, DLA lets you configure and trigger a pre and post-backup quiescing script to inform the database to commit to disk during the duration of the backup. This is a commonly used method for other databases, such as PostgreSQL and MySQL.

You will need to ensure that the script is placed in /etc/datto/dla/pps to be recognized by the Datto appliance.

The script should use the Native SQL Snapshot commands by directly invoking them, as detailed by SAP HANA: Create a Data Snapshot (Native SQL).

Notably, creation of the snapshot should occur in the PRE section of the DLA quiescing script, and marking of the snapshot as Successful or Abandoned should occur in the POST section. Refer back to the above documentation and SAP HANA support for more information.