edit-icon download-icon

SAP HANA Backup and Restore

Last Updated: May 22, 2018

We recommend that you read the following SAP official documents before backing up and restoring the SAP HANA database.

Documentation
SAP Note 1642148 FAQ SAP HANA Database Backup & Recovery
SAP Note 2091951 Best Practice: SAP HANA Backup & Restore
SAP HANA Administration Guide

Use Alibaba Cloud services to backup and restore the SAP HANA database

OSS

Object Storage Service (OSS) is a massive, secure, cost-effective and highly reliable cloud storage service from Alibaba Cloud. OSS allows you to upload and download data at any time and anywhere, and perform simple data management through the Web console. OSS is charged by the actual capacity. OSS plays a critical role in backup and restoration of the SAP HANA database on Alibaba Cloud. For more information about OSS, see the related Alibaba Cloud OSS documentation https://www.alibabacloud.com/help/product/31815.htm

ECS

Elastic Compute Service(ECS) is a basic cloud computing service provided by Alibaba Cloud. Using ECS is as convenient and efficient, just like using water, electricity, or gas. Instead of buying hardware in advance, you can create a specific number of ECS instances at any time as required to meet your business needs, and resize disks and increase the bandwidth of ECS as you business continues growing. If you do not need ECS, you can easily release the resources to save the cost.

ECS capabilities:

  • ECS instance
    An ECS instance is a virtual computing environment that includes the CPU, memory, operating system, disk, network, and other basic server components. It is the actual operating entity offered to each user. An instance is equivalent to a virtual machine. You have the administrator permission for the created instances manage the instances at any time. You also can perform basic operations on an instance, such as attaching a disk, creating a snapshot, creating an image, or deploying an environment.
  • Image
    An image is a template of environment you choose to run the ECS instances. It generally includes an operating system and preinstalled software. It may only contain the basic operating system, or have a specific software environment integrated on top of the OS. You can create an ECS instance on the basis of an image, so as to obtain a system environment consistent with the image.
  • Region and zone
    A region is a physical data center.
    A zone is a physical area with independent power grids and networks in one region. The network latency for ECS instances within the same zone is shorter.
    Intranet communication can take place between zones in the same region, and fault isolation can be performed between zones. Whether to deploy ECS instances in the same zone depends on the requirements for disaster tolerance capabilities and network latency.
  • Block storage — cloud disk
    Block storage is a low-latency, persistent, and high-reliability random block-level data storage service Alibaba Cloud provides to ECS. Block storage supports the automatic copying of your data within the zone. It prevents unexpected hardware faults from causing data unavailability and protects your service against the threat of component faults. You can format a block storage attached to an ECS instance and create a file system and persist data on it just like on a hard disk. To meet the needs of different application scenarios, three types of block storage options are available for choosing: SSD cloud disk, ultra cloud disk, and basic cloud disk.
  • Cloud disk snapshot
    A snapshot is a restore point created for a disk. It contains the disk data at the specified time and can be used to restore disk data or create custom images.

For more information about ECS, see the related Alibaba Cloud ECS documentation https://www.alibabacloud.com/help/product/25365.htm.

RAM

Resource Access Management (RAM) is an Alibaba Cloud service designed for controlling resource access. Using RAM, you can create multiple RAM user accounts under your cloud account, and allocate corresponding resource operation permissions to them. In this way, you can collectively manage your user accounts (such as employees, systems, and applications) and control the permissions that these user accounts possess for resources under your account.

When you use OSS to store backup files of the SAP HANA database, you can use RAM to authorize specific users to access the backup files. For more information about RAM, see the related Alibaba Cloud RAM documentation https://www.alibabacloud.com/help/product/28625.htm.

Storage of the SAP HANA database backups on Alibaba Cloud

The greatest difference between backing up the SAP HANA database on a traditional physical machine and on Alibaba Cloud is the destination of backups. The traditional physical machine stores the database backups on tapes, while Alibaba Cloud keeps them on OSS. The advantages of storing the SAP HANA database backups on OSS are as follows: OSS automatically stores three copies of data in different locations by default to ensure 99.999999999% data reliability. It is capable of enterprise-grade multilevel security protection, and provides the multi-user resource isolation mechanism, remote disaster tolerance mechanism, multiple authentication and authorization mechanisms, as well as the whitelist, anti-leech, and primary account/subaccount features.

The SAP HANA database backups are first stored in the /hana/backup directory of the data cloud disk to which ECS instances are attached. You must copy the backup files in the cloud disk to OSS for long-term storage.

Permission management for backup files

To authorize users to access SAP HANA backup files in the OSS bucket, you must follow these steps to configure the user access rules in the RAM console:

  1. Select a user to access OSS and click “Authorize”.
    sap-hana-backup-restore-ram-1-en

  2. Select an authorization rule.
    sap-hana-backup-restore-ram-2-en

  3. As the owner of the Alibaba Cloud account, you are required to enter the verification code (which will be sent to your registered mobile phone).

  4. If the verification succeeds, you can check and set corresponding access permissions for users on the authorization rule panel.
    sap-hana-backup-restore-ram-3-en

  5. You can also create custom authorization rules on the authorization rule panel. For more information about permission management, see RAM authorization policy management.

Note about backup and restoration

Before preparing the related backup policies for your SAP HANA system on Alibaba Cloud, learn about the following key information about backup (file system backup, to be specific), storage snapshot (cloud disk snapshot), and restoration.

One of the main measures to ensure data security of SAP HANA is to perform a file system backup of files, data, and logs in the SAP HANA database. You can also use the snapshot feature of the cloud disk of Alibaba Cloud ECS to regularly back up the snapshots of the data disk where logs and the data file system of SAP HANA are located.

SAP HANA backup and storage snapshot

  • Backup files of the SAP HANA database are stored in the /hana/backup directory by default.
  • Alibaba Cloud also supports data backup by storage snapshots.
  • Data and logs can be backed up only when the SAP HANA database is online. (All configured services are running.)
  • The database can be normally used when a data backup, log backup, or storage snapshot is being created.
  • Before initial data backup or snapshot storage is complete, the log mode is “overwrite”. When the log mode is overwrite, no log backup file is generated.
  • Individual objects in the database cannot be backed up or restored. Backup and restoration always apply to the entire database.
  • Only actual data is backed up, and unused space in the database is not backed up. Data backup includes restoration of all data structures required by the database, and does not include customers’ special configurations.
  • A storage snapshot obtains the content of all data zones of SAP HANA in a specific time point.

File system backup for the multi-node SAP HANA system

  • The configuration target path for data and log backup must be valid across the system, not just for a specific host.
  • If you use a file-based backup mode to back up a multi-node SAP HANA system, it is strongly recommended that you use shared storage that is available for all nodes in the cluster for backup.

Restoration

  • The SAP HANA database must be shut down, and cannot be accessed by an end user or application during restoration.
  • The SAP HANA database cannot be restored to any version that is earlier than the existing version. The software version used for restoring the SAP HANA database must be the same or later than the version of the SAP HANA database backed up.
  • Before a restoration is started, at least one data backup or one storage snapshot needs to be prepared.
  • When a restoration is started, all data and log backups must be accessible through the file system or a third-party backup tool. If you restore the database from a storage snapshot, the storage snapshot must be available in the data zone.
  • You cannot pause and resume a database restoration.
  • You can cancel a running restoration. However, canceling the restoration will lead to database state inconsistency.
  • If a restoration fails, you must re-perform the full restoration process.
  • During log restoration, the incremental merge operations cannot be performed.
  • During the restoration, the number of hosts on your target system is unrestricted, provided that the number of hosts and type of services of the source system are consistent with those of the target system.

Backup and restoration for the SAP HANA database of a non-production system

This section provides several options for backing up the SAP HANA database of a non-production system. Non-production systems include:

  • Demonstration system
  • Training system
  • Sandbox system
  • PoC verification system

Typical requirements for backup and restoration for the SAP HANA database of a non-production system:

  • Infrequent backups
  • Point-in-time not required
  • Simple and low cost

Cloud disk snapshots provide a simple and low-cost solution to meet the backup and restoration requirements for the SAP HANA database of non-production systems. The snapshot service provides a flexible policy. Using this service, you can take a cloud disk snapshot at any time and multiple cloud disk snapshots in a day, and configure the related snapshot policies to enable the system to automatically take a cloud disk snapshot in a specific day. You can also configure the time for retaining a cloud disk snapshot, or save a cloud disk snapshot permanently.

For more information about the cloud disk snapshot, see Alibaba Cloud cloud disk snapshot.

Backup mode

You can regularly take snapshots on the SAP HANA system disk (/usr/sap), data disk (/hana/data), and log disk (/hana/log) of ECS instances where SAP HANA is installed to back up the SAP HANA database of non-production systems.

Restoration mode

You can use cloud disk snapshots of the SAP HANA system disk (/usr/sap), data disk (/hana/data), and log disk (/hana/log) of ECS instances where SAP HANA is installed to manually restore the ECS instances of the entire non-production system.

Backup and restoration for the SAP HANA database of a production system

Typical requirements for backup and restoration for the SAP HANA database of a production system:

  • Frequent and regular backup and plan
  • Point-in-time database restoration

Backup mode

  • By default, the initial backup destination for backup files of the SAP HANA database on Alibaba Cloud is a local cloud disk that is attached to an ECS instance.
  • You can start and arrange a SAP HANA database backup using SAP HANA Studio, SQL commands, or SAP DBA Cockpit. Unless being manually disabled, log files will be automatically backed up.
  • You must regularly save the SAP HANA backup files on the local cloud disk to the OSS bucket for long-term storage.
  • If cross-region data redundancy is required, the SAP HANA backup files saved in the OSS bucket can be copied to different regions of Alibaba Cloud based on your settings.

Backup example

A typical backup task may require the following steps:

  1. In the SAP HANA backup editor, open the backup wizard. You can also right-click the system to be backed up and select “Backup” to open the backup wizard.sap-hana-backup-restore-backupexample-1

    • Select the target file type, and back up the database to the specified file system.

    • Specify the backup path /hana/backup/data/[SID] and backup prefix.
      sap-hana-backup-restore-backupexample-1

    • Click “Next”, and then click “Finish”. A message is displayed, instructing you to confirm the backup.
      sap-hana-backup-restore-backupexample-3

    • Make sure that the backup file is available on the operating system.
      sap-hana-backup-restore-backupexample-4

  2. Copy the backup file from the /hana/backup directory to the OSS bucket.

  3. Check whether the backup file has been copied to OSS.

Restoration mode

  • Copy the SAP HANA backup file stored in the OSS bucket to the backup directory of the cloud disk to which the ECS instance running SAP HANA is attached.
  • Run the backup file in the backup directory of the cloud disk to which the ECS instance running SAP HANA is attached to restore the SAP HANA database.

Restoration example

You can follow these steps to restore your SAP HANA database from the backup:

  1. If the backup file is not stored in the /hana/backup directory of the file system but is stored in Alibaba Cloud OSS, copy the backup file to the /hana/backup directory.

  2. Use the restoration wizard to restore the SAP HANA database.
    sap-hana-backup-restore-restoreexample-1

    • Select the correct time and the path to which the database is to be restored from the backup set.
      sap-hana-backup-restore-restoreexample-2

    • Carefully check and set the file to the target type.
      sap-hana-backup-restore-restoreexample-3

    • Check the summary and click “Finish” to restore the SAP HANA database.
      sap-hana-backup-restore-restoreexample-4

  3. After the restoration is complete, you can continue other operations and clear the backup file from the /hana/backup/[SID]/* directory.

Thank you! We've received your feedback.