SAP HANA Backup and Recovery

Stella981
• 阅读 761

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

 SAP HANA Backup and Recovery

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

SAP HANA Backup and Recovery

The following popup will appear.

 SAP HANA Backup and Recovery

Click Next

SAP HANA Backup and Recovery

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

SAP HANA Backup and Recovery

The backup will finish with the summary page.

SAP HANA Backup and Recovery

SQL Command for Backups

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

BACKUP DATA USING FILE ('')

SAP HANA Backup and Recovery

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 

SAP HANA Backup and Recovery

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"

SAP HANA Backup and 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.

SAP HANA Backup and Recovery

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

SAP HANA Backup and Recovery

The location of the data backup is specified next

SAP HANA Backup and Recovery

Additional Settings.

SAP HANA Backup and Recovery

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

SAP HANA Backup and Recovery

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.

 SAP HANA Backup and Recovery

Command Line

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

 ie) python /usr/sap//SYS/exe/hdb/python_support/recoverSys.py --password= --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 - 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

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

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

SAP HANA Academy - Backup and Recovery: Backup Catalog

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

点赞
收藏
评论区
推荐文章
blmius blmius
3年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
待兔 待兔
3个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Jacquelyn38 Jacquelyn38
3年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
Wesley13 Wesley13
3年前
Java获得今日零时零分零秒的时间(Date型)
publicDatezeroTime()throwsParseException{    DatetimenewDate();    SimpleDateFormatsimpnewSimpleDateFormat("yyyyMMdd00:00:00");    SimpleDateFormatsimp2newS
Wesley13 Wesley13
3年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
3年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
3年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
3年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
9个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这