文档章节

SAP HANA Backup and Recovery

rootliu
 rootliu
发布于 09/19 17:21
字数 2041
阅读 23
收藏 0

SAP HANA Backup and Recovery

Skip to end of metadata

Go to start of metadata

 

 

Purpose

This page is to explain the steps on how to perform a basic backup and recovery. At the end of this guide, there will be frequently asked questions and common problems that are encountered. For an in-depth explanation of the backup and recovery process, please see the Admin guide http://help.sap.com/hana/SAP_HANA_Administration_Guide_en.pdf.

System Privileges

In order to do a backup, the user will need the following privileges

  1. BACKUP ADMIN or BACKUP OPERATOR
  2. CATALOG READ
     

How to Perform a Backup

You can perform a full data backup through HANA Studio and also through SQL Statements.

Studio

Open SAP HANA Studio and on the navigator side (left hand side) expand your system and double click the ‘Backup’ icon

 


Press the "Backup" button.
** For a multi-tenant database, you will have the option to backup the system database and the tenant database. **

The following popup will appear.

 

Click Next

The backup will then show you the backup status and then finish.

The backup will finish with the summary page.

 

SQL Command for Backups

The SQL Command to perform a full data backup follows the syntax:

BACKUP DATA USING FILE ('<name of backup>')

 

Manual Backup Check

Although automatic checks take place while complete data backups and log backups are performed, you should manually re-check the integrity of any backup if it is copied or moved to another location. 

 

hdbbackupcheck -v <Backup file>

 

Recovery

To recover a SAP HANA database, the database needs to be shut down. During recovery, the database therefore cannot be accessed by end users or applications.

It may be necessary to recover the SAP HANA database in the following situations:

  • A disk in the data area is unusable.
  • A disk in the log area is unusable.
  • As a consequence of a logical error, the database needs to be reset to its state at a particular point in time.
  • You want to create a copy of the database.

There are a few different types of recovery

Most Recent State: Used for recovering the database to the time as close as possible to the current time. For this recovery the data backup and log backup have to be available since last data backup and log area are required to perform the above type recovery

Point in Time: Used for recovering the database to the specific point in time.  For this recovery the data backup and log backup have to be available since last data backup and log area are required to perform the above type recovery

Specific Data Backup: Used for recovering the database to a specified data backup. Specific data backup is required for the above type of recovery option.

Specific Log Position: This recovery type is an advanced option that can be used in exceptional cases where a previous recovery failed.

Restrictions for Recovery

  • A SAP HANA database cannot be recovered to a SAP HANA database with a lower software version. The SAP HANA database software version used for the recovery must always be the same version or higher than the SAP HANA database used to create the backup.
  • There can be any number of hosts in the target system, provided that the number and type of services is identical in both the source and the target system.
  • With SAP HANA multi-tenant database containers, recovery using snapshots is not supported yet. Tenant databases can be recoverd via the relevant system database only.

 

Recovery Process

The database can be recovered from HANA Studio and also from SQL Commands.

 

Studio

Right click on the HANA system and then select "Backup and Recovery", then "Recovery"

The HANA system will stop and then the recovery wizard will appear. From here, select the recovery option. In this example, I chose to recover from 2 hours ago.

Ensure that the log backup directory is correct. ** This is important if you are recovering onto a different HANA instance **

The location of the data backup is specified next

Additional Settings.

Confirm all of the settings are correct and then select Finish.

The recovery will take some time. After HANA has performed the recovery, the following screen is displayed. The HANA system will start automatically after a successful recovery.

 

 

Command Line

The Python script recoverSys.py supplies the restore command to the services and starts the database.

  ie) python /usr/sap/<SID>/SYS/exe/hdb/python_support/recoverSys.py --password=<sidadm passwd> --wait --command="RECOVER DATABASE UNTIL TIMESTAMP '2013-03-29 23:59:59'"

1. Restore until most recent state - choose a current timestamp or one in the future

      RECOVER DATABASE UNTIL TIMESTAMP 'YYYY-MM-DD HH:MM:SS'

    Ex: RECOVER DATABASE UNTIL TIMESTAMP '2013-03-22 15:00:00'

2. Restore until Point in time

      RECOVER DATABASE UNTIL TIMESTAMP 'YYYY-MM-DD HH:MM:SS'

   Restore until point in time with timestamp using further directories containing log backups

      RECOVER DATABASE UNTIL TIMESTAMP 'YYYY-MM-DD HH:MM:SS' CHANGE ALL LOG USING PATH ('/usr/sap/SH1/HDB00/backup/logs1/‘, '/usr/sap/SH1/HDB00/backup/logs2/')

   Ex: RECOVER DATABASE UNTIL TIMESTAMP '2013-03-01 15:00:00' USING DATA PATH ('/usr/sap/SH1/HDB00/backup/data/COMPLETE') USING LOG PATH ('/usr/sap/SH1/HDB00/backup/logs1/‘, '/usr/sap/SH1/HDB00/backup/logs2/')

Common Questions

 

The following are problems have been encountered by customers in the past.  

 

Q: Can backups be recovered to a SAP HANA database with a higher software version?

A:  This is answered in SAP Note 1642148 - FAQ: SAP HANA Database Backup & Recovery

"

Yes.

You can recover data and log backups created with a SAP HANA database software version lower or equal to the target database. Data and log backups cannot be recovered to a SAP HANA database with a lower software version.

If you are updating your SAP HANA database from a maintenance revision to a support package, certain restrictions apply.

More information: SAP Note 1948334 (SAP HANA Database Update Paths for Maintenance Revisions)

"

Q: I am recovering using a backup from a multi-node to a single-node environment, what should I check before performing this recovery?

A: The most common problem with recovery from a different system is a mismatch in topology. For example, the backup was taken from a system that has 2 indexservers and you want to recover it on a system that has only 1 indexserver. If you attempt to do this, the recover will fail and you will need to recover back to the original state.

The most common service that is mismatching is the Embedded statistics server. To check this, compare the nameserver.ini in the source and the target for [statisticsserver] -> active = true.
The second most common service that is mismatching is the indexserver. Consult SAP Note 2093572 - SAP HANA Migration from Multi-Node to Single-Node for more details on how to configure the target system to match the backup landscape.

Q: If a recovery fails, my HANA server does not start.

A: This is a typical behavior of HANA. You must recover from a working backup (that has the same topology)

 

Q: How do you perform a system refresh?

A: Follow this note to perform a system refresh using SWPM. Please see SAP Note 1844468 - Homogenous system copy on SAP HANA 

 

Q: I'm performing a recovery from SPS09, is there anything I need to be aware of?

A: If you have upgraded to SPS09, you should ensure that you perform a full data backup prior to attempting a recovery. See SAP Note 2119628 - Missing or wrong data after recovery of older backup with SAP HANA SPS09.After you have successfully recovered again, perform another full data backup. See SAP Note 2097985 - Point-in-Time Recovery Fails After Data Restore.

Q: If there is a failed backup, what do I do first?

A: Consult the backup.log for more details on the error. This is one of the first things to do. Once you determine the error, you can search SAP KBA's for a solution.

 

Q: What is the process of archiving system-based backups?

A: Refer to SAP Note 1817703 - Archiving file system-based backups  and SAP Note 2096851 - Management of Old Backups in HANA, to determine if backup files can be archived.

 

Q: We want to upgrade our Backint system, what needs to be done on HANA?

A: Refer to SAP Note 2009486 - Disable SAP HANA log backups during upgrade of third-party backup tool that supports the Backint for SAP HANA interface

 

Q. When copying or refreshing one SAP HANA system from a backup taken from another SAP HANA system, can the schema name be changed? 

A. It is not possible to change the schema name on the SAP HANA database. Please see SAP Note 1642148 - FAQ: SAP HANA Database Backup & Recovery

 

Q: My backups are performing slow, what can I do?
A:  SAP Note 1835075 - Analyze backup and recovery performance issues,  provides detailed steps on how to analyze performance in relation to backups and recovery.


Q: How do you cancel a running backup?
A: To cancel a running backup, please use the following 3 SQL statements:

  1. Get the backup_id of your running backup:
    select BACKUP_ID from "SYS"."M_BACKUP_CATALOG" where entry_type_name = 'complete data backup' and state_name = 'running'  order by sys_start_time desc
  2. Cancel the backup
    backup cancel <backup_id>
  3. Confirm the backup has cancelled
    select state_name from "SYS"."M_BACKUP_CATALOG" where backup_id = <backup_id>
  4. Check to  make sure there are no running backups still
    select * from  "SYS"."M_BACKUP_CATALOG" where STATE_NAME = 'running';
  5. If the backup still exists, you can try to cancel the thread through the commands:
    ALTER SYSTEM CANCEL SESSION ;
    ALTER SYSTEM DISCONNECT SESSION ;

Q: How do I determine what redo log files are needed for my restore?
A: Follow the steps in this note: 1705945  - Determining required restoration files

Q: Can I use a backup taken with 3rd party tools (backint) to perform a system copy? 

A: Yes, please follow the steps of the admin guide at

http://help.sap.com/saphelp_hanaplatform/helpdata/en/ea/5004bdab024061afd1caae7d309263/content.htm

  

Q: How do you enable further tracing if a backup is failing?
A: Run the following command in sql editor:

Enable the trace ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') SET ('backup', 'trace') = 'debug' with reconfigure;
Disable the trace ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') UNSET ('backup', 'trace') with reconfigure;

 

Issues and Reported Problems

 

Error: This error occurs when I try to recover "Could not recover system <SID> - Could not start master name server"?

Solution: When a recovery is initiated in SAP HANA Studio, the database, if still running, will be shutdown. The database is then restarted automatically during recovery. If for some reason, the database cannot be shutdown completely before the recovery, i.e. some server processes cannot be stopped, the restart and ultimately the recovery will fail. Consult SAP Note 1944052 - Recovery failed due to hdbdaemon process not able to stop

 

Related Documents

 

SCN Document SAP HANA Backup/Recovery Overview

SCN Blog: Back it on up…..then recover it

SCN: Backup and Recovery - HANA

SCN: SAP HANA Academy: Backup and Recovery - Backup Catalog

 

Related Videos:

SAP HANA Academy - Backup and Recovery: Storage Snapshot [SPS 08]

SAP HANA Academy - Backup and Recovery: Backup Catalog

 

Related SAP Notes/KBAs

SAP Note: 1642148  - FAQ: SAP HANA Database Backup & Recovery

SAP Note: 2093572  - SAP HANA Migration from Multi-Node to Single-Node

SAP Note: 1651055 - Scheduling SAP HANA Database Backups in Linux

SAP Note: 2044438 - HANA: Backup fails for Out Of Memory error

SAP Note: 2122316  - mvcc garbage collection is blocked while data backup when auditing is enabled

SAP Note 2123153  - HANA Recovery Failing with "recovery strategy could not be determined"

SAP Note 1730932 - Using backup tools with Backint for HANA

SAP Note 1730998 - Unrecommended versions of backup tools

SAP Note 2063454 - Long running log backups

SAP KBA 2101244 - FAQ: SAP HANA Multitenant Database Containers (MDC)

SAP Note 2096000 - SAP HANA multitenant database containers - Additional Information

SAP KBA 2486224 - Tenant DB recovery to another system Tenant DB

 

 

 

 

本文转载自:https://wiki.scn.sap.com/wiki/display/SAPHANA/SAP+HANA+Backup+and+Recovery

共有 人打赏支持
rootliu
粉丝 4
博文 280
码字总数 2796
作品 0
海淀
数据库管理员
私信 提问
How to Backup SAP HANA Database using Command Line

How to Backup SAP HANA Database using Command Line Updated on January 7, 2014 by Rahul K. Databases SAP HANA is an in-memory data platform that is deployable as an on-premise ap......

rootliu
09/28
0
0
HANA tenant backup

HANA tenant backup Hello, Script from note 1651055 - Scheduling SAP HANA Database Backups in Linux isn't Multi-Tenant complient. I modified script to be able to backup tenant da......

rootliu
09/19
0
0
NBU 备份 SAP HANA

一. 链接libelf.so.0 检查并确定 libelf.so.0 通过符号链接到 libelf.so.0.8.13 文件。这些文件位于 /usr/lib64/ 二. 更新initSAP.utl文件 1. initsap.utl 文件位于以下路径: /usr/openv/ne...

lanlinlan
06/26
0
0
HANA 2.0 Cockpit Installation and Configuration

SAP HANA 2.0 Cockpit Installation and Configuration How to Guide December 14, 2017 | 17,350 Views | Former Member SAP HANA, platform edition HANA 2.0 CockpitS/4HANA RIGSAP HANA ......

rootliu
09/28
0
0
secure storage password recovery的问题

重置HANA数据库管理密码后,可能会遇到,使用HDBSTUDIO不断提示输入secure storage password的窗口,但是不知道密码。再不断cancel进入HDBSTUDIO后。 进入 Window——》Preferences——》Gen...

boydreaming
2016/02/14
20
0

没有更多内容

加载失败,请刷新页面

加载更多

Android :报错Your project path contains non-ASCII characters.

报错内容如下 Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See ht......

lanyu96
9分钟前
0
0
[LintCode] Number of Islands(岛屿个数)

描述 给一个01矩阵,求不同的岛屿的个数。 0代表海,1代表岛,如果两个1相邻,那么这两个1属于同一个岛。我们只考虑上下左右为相邻。 样例 在矩阵: [ [1, 1, 0, 0, 0], [0, 1, 0, 0, ...

honeymose
9分钟前
0
0
Nginx平滑添加模块

Nginx已经编译安装并运行了一段时间, 然后某一天, 发现需要用到某个模块但当初没有编译, 这个时候怎么办呢? 卸载重新安装肯定可以的, 如果Nginx版本没有变更的话, 则有一个相对平滑的方法来添...

老菜鸟0217
14分钟前
1
0
spark安装测试

spark安装测试 由于本地已经安装好hadoop相关组件,所以本文是在yarn的基础上对spark进行安装及测试 确保hdfs及yarn成功启动,hadoop版本为2.7.3 安装scala,由于本人安装的spark是2.4.0,对应...

-九天-
28分钟前
3
0
周末看完了《电能计量自动化技术》

整体质量还行,下面分别将心得记录如下: 第一章:发展历程可以看看,现在算是智能电网阶段 2:讲主站系统。以文件进行各模块的交互很值得思考,尤其是批量数据,多团队合作的情况下。另外线...

max佩恩
48分钟前
7
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部