- Use Alibaba Cloud services to backup and restore the SAP HANA database
- Destination of the SAP HANA database backups on Alibaba Cloud
- Permission management for backup files
- Key points about backup and restoration
- Backup and restoration for the SAP HANA database of a non-production system
- Backup and restoration for the SAP HANA database of a production system
You are advised to read the following SAP official documents before backing up and restoring the SAP HANA database.
|SAP Note 1642148 FAQ SAP HANA Database Backup & Recovery|
|SAP Note 2091951 Best Practice: SAP HANA Backup & Restore|
|SAP HANA Administration Guide|
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 details about OSS, refer to the related Alibaba Cloud OSS documentation https://www.alibabacloud.com/help/product/31815.htm
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 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 and can log on to, use and 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.
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 details about ECS, refer to the related Alibaba Cloud ECS documentation https://www.alibabacloud.com/help/product/25365.htm.
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 details about RAM, refer to the related Alibaba Cloud RAM documentation https://www.alibabacloud.com/help/product/28625.htm.
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 white list, 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 need to copy the backup files in the cloud disk to OSS for long-term storage.
To authorize users to access SAP HANA backup files in the OSS bucket, you need to perform the following operations to configure the user access rules in the RAM console:
Select a user to access OSS and click “Authorize”.
Select an authorization rule.
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).
If the verification succeeds, you can check and set corresponding access permissions for users on the authorization rule panel.
You can also create custom authorization rules on the authorization rule panel. For details about permission management, refer to RAM authorization policy management.
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.
- Backup files of the SAP HANA database are stored in the
/hana/backupdirectory 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.
- 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.
- 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 need to 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.
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 details about the cloud disk snapshot, refer to Alibaba Cloud cloud disk snapshot.
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.
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.
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
- 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 need to 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.
A typical backup task may require the following steps:
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.
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.
Click “Next”, and then click “Finish”. A message is displayed, instructing you to confirm the backup.
Make sure that the backup file is available on the operating system.
Copy the backup file from the
/hana/backupdirectory to the OSS bucket.
- Check whether the backup file has been copied to OSS.
- 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.
You can perform the following steps to restore your SAP HANA database from the backup:
If the backup file is not stored in the
/hana/backupdirectory of the file system but is stored in Alibaba Cloud OSS, copy the backup file to the
Use the restoration wizard to restore the SAP HANA database.
Select the correct time and the path to which the database is to be restored from the backup set.
Carefully check and set the file to the target type.
Check the summary and click “Finish” to restore the SAP HANA database.
After the restoration is complete, you can continue other operations and clear the backup file from the