SAP HANA Backup Notes

3
25th March 2013 SAP HANA is an in-memory database or a database that stores its database tables in RAM. RAM is the fastest possible data storage media available today but it is volatile. This means that when the RAM chips lose power, the data bits on the chip are erased or lost. To avoid data loss, SAP HANA incorporates regular save points using two persistent storage volumes The first is the database logging or redo log mount. Most SAP HANA hardware vendors will place this file system on a Fusion-IO SLC or MLC nand flash card or use a RAID 10 controller with an array with SSD disks to accommodate this mount. When you write data to SAP HANA, it is written to the logs first then moved into RAM. The log mount should accommodate 100,000+ IOPS. The second mount point is the persistent data storage mount point. This is typically mounted on a standard magnetic disk array and it is used to store a copy of all committed data that is stored in-memory. With the combination of both redo logging and in-memory data save points, the SAP HANA system is fully capable of recovering from a sudden power failure. However, what happens when you lose the logging or persistent data storage mounts? Better yet, what happens when my SAP HANA server is no longer usable? To overcome these potential problems, regular backups of the SAP HANA system are required. This article will walk you through the process of backing up the SAP HANA database and help you identify the components that are critical to the processes. Question: What are the key backup components of the SAP HANA system? The data and metadata When performing a backup of the SAP HANA system the tables, views, undo logs, packages, information views and metadata are all saved to a configurable persistent disk location. In short, all of the data and code that is stored in SAP HANA will be backed up to a path that you specify. The default location of the data backup is configured as $(DIR_INSTANCE)/backup/data. Backups can be triggered using the SAP HANA studio, the DBA Cockpit in BW, SQL script commands or 3 rd party tools. They are not automatically run by the SAP HANA system. Each HANA DBA will have to devise a backup strategy with the hardware vendor before purchasing SAP HANA to insure that they have the appropriated hardware to support the backup process. To initiate a backup using SQL scripts run the following from the SAP HANA Studio SQL window. BACKUP DATA USING FILE (‘COMPLETE_DATA_BACKUP’) To initiate a backup using the hdbsql command line, run the following command using the SAP HANA client that is installed on your SAP HANA Linux server. ./hdbsql -i 0 -n localhost -u backup_user -p xxxx “BACKUP DATA USING FILE (‘COMPLETE_DATA_BACKUP’)” To initiate the backup using SAP HANA studio, right click your system in the navigation window and choose the backup option. SAP HANA Backup Notes

description

SAP HANA

Transcript of SAP HANA Backup Notes

Page 1: SAP HANA Backup Notes

25th March 2013

SA P HA N A is an in-memory database or a database that stores i ts database tables in RA M. RA M is the fastest possible data storage media

avai lable today bu t i t is volati le. This means that when the RA M chips lose power, the data bits on the chip are erased or lost. To avoid data

loss, SA P HA N A incorporates regu lar save points u sing two persistent storage volumes The first is the database logging or redo log

mou nt. Most SA P HA N A hardware vendors wi l l place th is fi le system on a Fu sion-IO SLC or MLC nand flash card or u se a RA ID 10

control ler with an array with SSD disks to accommodate th is mou nt. When you write data to SA P HA N A , i t is written to the logs first then

moved into RA M. The log mou nt shou ld accommodate 100,000+ IOPS. The second mou nt point is the persistent data storage mou nt point.

This is typical ly mou nted on a standard magnetic disk array and i t is u sed to store a copy of al l committed data that is stored in-memory.

With the combination of both redo logging and in-memory data save points, the SA P HA N A system is fu l ly capable of recovering from a

su dden power fai lu re. However, what happens when you lose the logging or persistent data storage mou nts? Better yet, what happens

when my SA P HA N A server is no longer u sable? To overcome these potential problems, regu lar backu ps of the SA P HA N A system are

requ ired. This article wi l l walk you throu gh the process of backing u p the SA P HA N A database and help you identi fy the components that

are cri tical to the processes.

Question: What are the key backup components of the SAP HANA system?

The data and metadata

When performing a backup of the SAP HANA system the tables, views, undo logs, packages, information

views and metadata are all saved to a configurable persistent disk location. In short, all of the data and code

that is stored in SAP HANA will be backed up to a path that you specify.

The default location of the data backup is configured as $(DIR_INSTANCE)/backup/data. Backups can be

triggered using the SAP HANA studio, the DBA Cockpit in BW, SQL script commands or 3rd party tools.

They are not automatically run by the SAP HANA system. Each HANA DBA will have to devise a backup

strategy with the hardware vendor before purchasing SAP HANA to insure that they have

the appropriated hardware to support the backup process.

To initiate a backup using SQL scripts run the following from the SAP HANA Studio SQL window.

BACKUP DATA USING FILE (‘COMPLETE_DATA_BACKUP’)

To initiate a backup using the hdbsql command line, run the following command using the SAP HANA client

that is installed on your SAP HANA Linux server.

./hdbsql -i 0 -n localhost -u backup_user -p xxxx “BACKUP DATA USING FILE

(‘COMPLETE_DATA_BACKUP’)”

To initiate the backup using SAP HANA studio, right click your system in the navigation window and choose

the backup option.

SAP HANA Backup Notes

Page 2: SAP HANA Backup Notes

[http://jdh2n.files.wordpress.com/2013/03/sap_hana_studio_backup.gif]

For more information see the SAP HANA Technical Operations

Manualhttp://help.sap.com/hana/hana_tom_en.pdf [http://help.sap.com/hana/hana_tom_en.pdf]

The logs

By default, the SAP HANA system will create log file backup every 15 minutes (900 seconds) or when the

standard log segments become full. They are also backed up when the SAP HANA system starts. These log

backups can be used during the SAP HANA recovery processes to role the logs forward or backwards to a

specific point in time. Each time the log backup job runs, a log segment snapshot or series of files are created

in the $(DIR_INSTANCE)/backup/log directory. During the log file backup processes, new files are created

each time the job runs. The existing files are not automatically deleted or overwritten. In short, the files will

grow indefinitely until they are deleted by the SAP HANA DBA. This backup is independent of the standard

full system data backup mentioned in the data and metadata backup sections.

As mentioned above, the SAP HANA DBA will need to maintain this log file backup location either manually

or using a script. If you need to maintain roll backs for several months, I would recommend that you retain

several months of files. If you feel that your full system backup will be sufficient, I would only keep a few

days of these files.

The following is an example script that you can run on the SAP HANA host to delete any log backups that

are older than 5 days. Never delete your persistent change logs or database files directories.

Make sure you only delete the “log backups” and that you have the path correct before

deleting any files.

find /usr/sap/../../backup/log/* -mtime +5 -exec rm {} \;

Page 3: SAP HANA Backup Notes

T he configuration and backup catalog files

The SAP HANA configuration files are not included in the standard full system backup nor the automated

log file backups. You need to backup these files using a script or 3rd party backup tool.

The configuration files contain any custom SAP HANA parameters or settings that will be needed if a full

rebuild of the database is required. In addition there is a backup catalog file that needs to be

retained because it contains information that is needed for the point-in-time restore processes. The backup

catalog is not required for a full system restore but it should be backed-up with each full system backup.

Configuration File Locations

/usr/sap/../../SYS/global/hdb/custom/config/*

Backup Catalog File Locations

/usr/sap/../../SYS/global/hdb/metadata/*

Where should I store m y backup files?

While the SAP HANA system will store the backups on the local file system by default, it is best that you

store these files on a different file system entirely. This file system can be mounted to the SAP HANA

operating system but should be separate from the standard logging and persistent storage volumes. In

addition it would be wise to copy this mount to a disaster recover location, tape system or other backup

media to ensure the redundancy and availability of the backup files. In short, make sure that you have a plan

to manage both the standard full system backup files and the automatic log file backups.

SAP Notes:

Scheduling the SAP HANA Backups: 1651055 [https://service.sap.com/sap/support/notes/1651055]

SAP HANA database backup and recovery: 1642148 [https://service.sap.com/sap/support/notes/1642148]

Posted 25th March 2013 by Hari Prakash Nandoori

Enter your comment...

Comment as: Google Account

Publish

Preview

1 View comments

kalyan k 14 February 2014 02:14

Thanks for sharing your Info..it's very useful .we also provides the Best SAP HANA Online Training

Reply