Mais conteúdo relacionado Semelhante a HANA SPS07 Backup & Recovery (20) Mais de SAP Technology (20) HANA SPS07 Backup & Recovery1. What´s New? SAP HANA SPS 07
Backup & Recovery
(Delta from SPS 06 to SPS 07)
SAP HANA Product Management
November, 2013
4. What’s New in SAP HANA SPS 07: Backup and Recovery
Consistency check for data and log backups (I)
SAP HANA can check data and log backups for integrity using the hdbbackupcheck command
line tool
It is recommended to check backups, for example, after transfer to a different storage medium. Both
backups to the file system and backups to a 3rd party backup tool via the Backint interface can be
checked using hdbbackupcheck. hdbbackupcheck reads in the specified part of the backup,
checks its meta data for correctness and consistency, and checks the content for any later changes.
hdbbackupcheck is located in the following directory: /usr/sap/<SID>/SYS/exe/hdb
Syntax
hdbbackupcheck [options] <file> [-i <backupid>] [-e <ebid>]
-v
<file>
-i <backupid>
-e <ebid>
displays all known information
backup file name (full path)
checks if the backup corresponds to the specified backup ID
external backup ID; mandatory for checking backups in 3rd party backup tool
More information
SAP Note 1869119 - Checking backups using hdbbackupcheck
© 2013 SAP AG. All rights reserved.
Public
4
5. What’s New in SAP HANA SPS 07: Backup and Recovery
Consistency check for data and log backups (II)
Example 1: Simple check, data backup is OK
hdbbackupcheck backup/data/COMPLETE_DATA_BACKUP_databackup_1_1
Backup '/usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_databackup_1_1' successfully checked.
Example 2: Verbose check information, data backup is corrupted
hdbbackupcheck -v backup/data/COMPLETE_DATA_BACKUP_databackup_0_1
Check backup '/usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_databackup_0_1'.
[...] ERROR: [110088] Error reading backup from 'FILE'
'/usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_databackup_0_1‚
[110010] Unable to read source type information from backup
'[FILE][/usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_databackup_0_1]‚
ERROR: [110059] The backup /usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_databackup_0_1 appears to be
corrupt, size is 163801
ERROR: Backup '/usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_databackup_0_1' check failed.
Example 3: Additionally check whether the log backup corresponds to the specified backup ID
hdbbackupcheck backup/log/log_backup_1_0_491968_494784 -i 1380028606841
ERROR: [110057] Backup /usr/sap/XXX/HDB09/backup/log/log_backup_1_0_491968_494784 has Backup ID
1380028606713, but is expected to have Backup ID 1380028606841
ERROR: Backup '/usr/sap/XXX/HDB09/backup/log/log_backup_1_0_491968_494784' check failed.
© 2013 SAP AG. All rights reserved.
Public
5
6. What’s New in SAP HANA SPS 07: Backup and Recovery
Log backup: Changed file name layout
With SPS 07, the backup ID is now appended to the log backup file name
Note: Log backups with the old file name layout can still be used for recovery.
Example: Log backup of the service with volume ID 4
Old format:
Log_backup_4_0_14498624_14500288
New format:
Log_backup_4_0_14498624_14500288.1380197735496
© 2013 SAP AG. All rights reserved.
Public
6
8. What’s New in SAP HANA SPS 07: Backup and Recovery
Recovery on the command line (I)
In addition to SAP HANA studio, recovery is now also available on the command line
SQL statements for recovery cannot be executed using the normal SQL clients such as hdbsql
(recovery requires the database to be offline). For this reason, the Python script recoverSys.py is
used to pass SQL statements to SAP HANA.
Prerequisites
SAP HANA operating system user credentials
Recovery steps
1. The administrator calls the script with the required parameters, thus specifying recovery target time, recovery
type and further options
2. The script stops the SAP HANA database, prepares and executes the recovery
3. After the master name server of the SAP HANA database started successfully, the script terminates.
Note: At this point, the recovery is not complete yet. We recommend to call the script using the --wait
option, which will ensure that the script waits until the recovery has finished.
© 2013 SAP AG. All rights reserved.
Public
8
9. What’s New in SAP HANA SPS 07: Backup and Recovery
Recovery on the command line (II)
recoverSys.py syntax
You need to call recoverSys.py as follows:
HDBSettings.sh recoverSys.py [parameters]
Using the parameters, you pass the SQL command to recover the database
If you run HDBSettings.sh recoverSys.py without any parameters, recoverSys.py performs a recovery
to the most recent point in time
For more information on the parameters, see the SAP HANA Administration Guide
Example
Recover the database to a point in time and force the script to wait until the recovery has finished
HDBSettings.sh recoverSys.py --wait --command="RECOVER DATABASE UNTIL TIMESTAMP
'2013-08-22 15:00:00'"
© 2013 SAP AG. All rights reserved.
Public
9
10. What’s New in SAP HANA SPS 07: Backup and Recovery
Recovery on the command line (III)
SQL syntax for recovery
RECOVER DATABASE <until_definition> [<source_definition>] [USING BACKUP_ID
<int_const> | USING SNAPSHOT] [USING GUID <str_const>] [CHECK ACCESS
[ALL|USING FILE|USING BACKINT]] | <execute_recover_data>
Examples
Point in time recovery to 3pm UTC using data backups from directory /backup with prefix MONDAY and log
backups from additional directories
RECOVER DATABASE UNTIL TIMESTAMP '2011-08-22 15:00:00' USING DATA PATH
('backup/MONDAY/') USING LOG PATH ('/backup/logs1/','/backup/logs2/')
Data recovery without log replay using data backup files from directory /backup with prefix MONDAY
RECOVER DATA ALL USING FILE ('/backup/MONDAY') CLEAR LOG
© 2013 SAP AG. All rights reserved.
Public
10
11. What’s New in SAP HANA SPS 07: Backup and Recovery
Check whether recovery can be executed with the available backups (I)
An option to check whether you can reach a specified recovery target with the available
backups has been added to the hdbbackupdiag command line tool.
hdbbackupdiag is located in the following directory: /usr/sap/<SID>/SYS/exe/hdb
Checks:
All necessary backups are available and can be accessed
For file system backups:
– File exists at the original location or at a location that has been specified
– The current operating system user has read privileges for the file
– File size matches the size information from the file header
– The backup ID in the file matches with the backup ID recorded in the backup catalog
For backups written to a 3rd party backup tool:
– Backup is available in the 3rd party backup tool
Note: hdbbackupdiag does not check the backup content for consistency (use hdbbackupcheck).
© 2013 SAP AG. All rights reserved.
Public
11
12. What’s New in SAP HANA SPS 07: Backup and Recovery
Check whether recovery can be executed with the available backups (II)
Syntax
hdbbackupdiag --check [options]
-d
-i <backupid>
-u "YYYY-MM-DD HH:MM:SS"
Directory where backup catalog is located
ID of the data backup that is to serve as basis for the recovery
Target in UTC; if not specified youngest reachable time is used
Example
hdbbackupdiag --check -d $DIR_INSTANCE/backup/log –i 1380028112722
found backup catalog 1380031306827 from file /usr/sap/XXX/HDB09/backup/log/log_backup_0_0_0_0.1380031306827
using backup catalog 1380031306827 from file /usr/sap/XXX/HDB09/backup/log/log_backup_0_0_0_0.1380031306827
Backup '/usr/sap/XXX/HDB09/backup/data/COMPLETE_DATA_BACKUP_new_databackup_0_1' successfully checked.
[...]
Backup '/usr/sap/XXX/HDB09/backup/log/log_backup_4_0_13483264_13489600' successfully checked.
More information
SAP Note 1873247: Checking recoverability with hdbbackupdiag --check
© 2013 SAP AG. All rights reserved.
Public
12
13. What’s New in SAP HANA SPS 07: Backup and Recovery
Extended automatic checks for file system backups at the start of a recovery
In addition to checking for missing backups
at the start of a recovery, SAP HANA now
also automatically checks file system
backups for corruption
If a corruption is detected, for example size or
backup ID do not match with the information that
is recorded in the backup catalog, the recovery is
not started and details are displayed in the
recovery wizard and written to the backup log
file.
Note: The extended checks are executed for file
system backups only. If a 3rd party backup tool is
used, only the existence of the backups on the
3rd party backup server is verified.
© 2013 SAP AG. All rights reserved.
Public
13
14. What’s New in SAP HANA SPS 07: Backup and Recovery
Improved recovery progress reporting in SAP HANA studio
Progress reporting for a recovery now shows
the recovery in more detail
After the initial collection of system information
for the recovery, the recovery wizard now shows
the following phases (progress per service)
Phase 1: Data recovery
– using data backup or snapshot
Phase 2: Log recovery
– using log backups and/or log that is still available
in the log area
Phase 3: Restart
© 2013 SAP AG. All rights reserved.
Public
14
15. What’s New in SAP HANA SPS 07: Backup and Recovery
Cancel recovery from SAP HANA studio
A running recovery can now be cancelled from the recovery wizard in SAP HANA Studio
You need to confirm the cancelation. After you have canceled a recovery, you have to start a new
recovery.
© 2013 SAP AG. All rights reserved.
Public
15
17. What’s New in SAP HANA SPS 07: Backup and Recovery
Storage snapshot support (I)
SAP HANA supports the creation of storage snapshots, which can later be used for SAP HANA
recovery
There is a loose coupling between SAP HANA and the storage tool: storage snapshots are recorded in
the SAP HANA backup catalog
SAP HANA
Confirm storage
studio
Creating a snapshot
1. Using SAP HANA studio, prepare the database
for the storage snapshot. Technically, this creates
an internal data snapshot.
2. Using the storage tool, create a storage
snapshot of the SAP HANA data area
3. In SAP HANA studio, confirm the storage
snapshot as successful. An entry including the
external backup ID is written to the backup
catalog
© 2013 SAP AG. All rights reserved.
snapshot
Prepare database
SAP HANA Database
Storage
Tool
External Storage
Data snapshot
Data Area (Disk)
Create storage
snapshot
Public
17
18. What’s New in SAP HANA SPS 07: Backup and Recovery
Storage snapshot support (II)
Creating a snapshot
1. In the Systems view in SAP HANA studio, right-click on the system and choose Storage Snapshot...
Then choose the Prepare option.
Alternatively, you can use the SQL command:
BACKUP DATA CREATE SNAPSHOT COMMENT ‘snapshot_test’
2. Using the storage tool, create a storage snapshot of the SAP HANA data area
3. In SAP HANA studio, confirm the successful storage snapshot and enter the external snapshot ID.
Alternatively, you can use the SQL command:
BACKUP DATA CLOSE SNAPSHOT BACKUP_ID 3456789 SUCCESSFUL 'storage_id_12345‘
Storage snapshots are listed in the backup catalog. You can either display the backup catalog in SAP
HANA studio, or query it using SQL (system view M_BACKUP_CATALOG).
© 2013 SAP AG. All rights reserved.
Public
18
19. What’s New in SAP HANA SPS 07: Backup and Recovery
Storage snapshot support (III)
SQL syntax
BACKUP DATA CREATE SNAPSHOT [COMMENT <string>]
Prepares the database for the storage snapshot (creates internal data snapshot)
The internal data snapshot is a global internal savepoint similar to the internal savepoint for a data backup. As
long as the data snapshot exists, no complete data backup is possible
The data snapshot automatically gets a SAP HANA backup ID, which is stored in the backup catalog
The optional comment is also stored in the backup catalog
BACKUP DATA CLOSE SNAPSHOT BACKUP_ID <backup_id> <handshake>
<handshake>:=
<external_id>
SUCCESSFUL <external_id> | UNSUCCESSFUL [<error_reason>]
identifier provided by the storage tool
Confirm successful storage snapshot
As a result, SAP HANA marks the snapshot as valid in the backup catalog, and adds the external ID of the
storage snapshot
© 2013 SAP AG. All rights reserved.
Public
19
20. What’s New in SAP HANA SPS 07: Backup and Recovery
Storage snapshot support (IV)
Recovery using a snapshot
1. Using the storage tool, transfer the storage
snapshot to the data area of the SAP HANA
database
2. Using SAP HANA studio, recover the database
using the storage snapshot as basis (available in
the recovery wizard)
Note: All recovery options are available, including
point-in-time recovery using log backups/log from
the log area.
SAP HANA
Studio
Recover database
SAP HANA Database
Storage
Tool
External Storage
Snapshot
Data Area (Disk)
© 2013 SAP AG. All rights reserved.
Transfer storage
snapshot to data area
Public
20
21. What’s New in SAP HANA SPS 07: Backup and Recovery
Storage snapshot support (V)
Recovery using a snapshot
1. Stop the SAP HANA database
2. Using the storage tool, transfer the storage
snapshot to the data area of the database
3. In the Systems view in SAP HANA studio, rightclick on the system, select Recover... and choose
recovery type and log backup location as usual
4. On the Select Backup page, choose the storage
snapshot from the list
o Only the storage snapshot that was transferred to the
data area is marked as available and can be used
o Other storage snapshots are also listed, but marked as
unavailable
5. Specify further recovery options as usual and start
the recovery
© 2013 SAP AG. All rights reserved.
Public
21
22. What’s New in SAP HANA SPS 07: Backup and Recovery
Storage snapshot support (VI)
SQL syntax
RECOVER DATABASE <until_definition> USING SNAPSHOT
<until_definition>
Recovery target (timestamp or log position)
Recover database using a storage snapshot
Prerequisite: The storage snapshot needs to be available in the data area before the recovery starts
Example: Recover the database to a point in time based on a storage snapshot
RECOVER DATABASE UNTIL TIMESTAMP '2011-09-30 15:00:00' USING SNAPSHOT
© 2013 SAP AG. All rights reserved.
Public
22
24. What’s New in SAP HANA SPS 07: Backup and Recovery
SSFS: Data volume encryption root key included in backup
If storage snapshots are used as backups, the root key for the data volume encryption is
included in the automatic backup of the SSFS
The SSFS is always part of the data backup, but for file system or BACKINT backups it does not
include the data volume encryption root key.
The root key is only needed in recovery scenarios where a storage snapshot is used as the basis for
the recovery.
© 2013 SAP AG. All rights reserved.
Public
24
26. What’s New in SAP HANA SPS 07: Backup and Recovery
“Add host” integration into logging
When a new host is added, the database now records this and automatically writes an initial
data backup for this new host
The backup history is not interrupted. Up to SPS 07, a complete data backup needed to be executed
after adding a new host in a scale-out scenario, with users not able to work in the database until the
data backup had finished.
© 2013 SAP AG. All rights reserved.
Public
26
28. What’s New in SAP HANA SPS 07: Backup and Recovery
Deactivation of log mode LEGACY
Log mode LEGACY is deactivated in SAP HANA SPS 07
Log mode legacy has not been recommended since SAP HANA SPS 03
If a system is still running in log mode LEGACY, an upgrade to SAP HANA SPS 07 will fail with the
error message that the log mode first needs to be set to either NORMAL or OVERWRITE
For productive systems, we recommend log mode NORMAL because it provides the highest
security with regard to the restoration of data for a recovery of the SAP HANA database. In log mode
NORMAL, the system automatically creates log backups that can be used for a recovery in addition to
the data backups. However, more backup space is required in this log mode due to the log backups.
Therefore, an operational concept for administrating data and log backups is a prerequisite for using
log mode NORMAL.
For more information, see SAP Notes
1645183 - Changing log mode for SAP HANA DB
1823343 - Deactivate log mode LEGACY with SAP HANA SPS 07
© 2013 SAP AG. All rights reserved.
Public
28
30. SAP HANA Backup and Recovery
Backint Certification
In August 2013, SAP certified IBM Tivoli Storage Manager for Enterprise 6.4 for SAP HANA
Certification is an installation prerequisite for backup tools using the “Backint for SAP HANA” interface.
SAP Note 1730932 (Using backup tools with Backint)
Release announcement
Certified tools (as of 2013-08-14)
Vendor
Certified Backup Tool
Support Process
Symantec
NetBackup 7.5
SAP Note 1913568
IBM
Tivoli Storage Manager for Enterprise 6.4
SAP Note 1913500
Online listing of certified tools: http://www.sap.com/partners/directories/SearchSolution.epx
“Certification Category” = “SAP Certified – Integration with SAP HANA”
”SAP-Defined Integration Scenarios” = "HANA-BRINT 1.1”
Information for tool vendors: http://scn.sap.com/docs/DOC-34483
© 2013 SAP AG. All rights reserved.
Public
30
32. What’s New in SAP HANA SPS 07: Backup and Recovery
More information
SAP HANA documentation
Available on the SAP Help Portal at
http://help.sap.com/hana_platform
SAP HANA Administration Guide,
“Backing Up and Recovering the SAP HANA Database”
SAP HANA Technical Operations Manual
Important SAP Notes
1642148: FAQ: SAP HANA database backup and recovery
1730932: Using backup tools with Backint
1869119: Check backup integrity
For further notes on backup/recovery, see BC-DB-HDB-BAC
Backint for SAP HANA certification
Certification announcement and description
© 2013 SAP AG. All rights reserved.
Public
32
33. Disclaimer
This presentation outlines our general product direction and should not be relied on in making
a purchase decision. This presentation is not subject to your license agreement or any other
agreement with SAP.
SAP has no obligation to pursue any course of business outlined in this presentation or to
develop or release any functionality mentioned in this presentation. This presentation and
SAP’s strategy and possible future developments are subject to change and may be changed
by SAP at any time for any reason without notice.
This document is provided without a warranty of any kind, either express or implied, including
but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or
non-infringement. SAP assumes no responsibility for errors or omissions in this document,
except if such damages were caused by SAP intentionally or grossly negligent.
© 2013 SAP AG. All rights reserved.
Public
33
35. © 2013 SAP AG. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.
The information contained herein may be changed without prior notice.
Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.
These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and
SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in
the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other
countries.
Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.
© 2013 SAP AG. All rights reserved.
Public
35
36. © 2013 SAP AG. Alle Rechte vorbehalten.
Weitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrückliche schriftliche
Genehmigung durch SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden.
Einige der von der SAP AG und ihren Distributoren vermarkteten Softwareprodukte enthalten proprietäre Softwarekomponenten anderer Softwareanbieter.
Produkte können länderspezifische Unterschiede aufweisen.
Die vorliegenden Unterlagen werden von der SAP AG und ihren Konzernunternehmen („SAP-Konzern“) bereitgestellt und dienen ausschließlich zu Informationszwecken.
Der SAP-Konzern übernimmt keinerlei Haftung oder Gewährleistung für Fehler oder Unvollständigkeiten in dieser Publikation. Der SAP-Konzern steht lediglich für Produkte
und Dienstleistungen nach der Maßgabe ein, die in der Vereinbarung über die jeweiligen Produkte und Dienstleistungen ausdrücklich geregelt ist. Keine der hierin
enthaltenen Informationen ist als zusätzliche Garantie zu interpretieren.
SAP und andere in diesem Dokument erwähnte Produkte und Dienstleistungen von SAP sowie die dazugehörigen Logos sind Marken oder eingetragene Marken der SAP
AG in Deutschland und verschiedenen anderen Ländern weltweit. Weitere Hinweise und Informationen zum Markenrecht finden Sie unter http://www.sap.com/corporateen/legal/copyright/index.epx#trademark.
© 2013 SAP AG. All rights reserved.
Public
36
Notas do Editor In example 2, I intentionally deleted some lines from the backup file on disk in order to simulate a corruption. Example does not specify target time -> youngest reachable time is used as target (=„now“)More options are available, check SAP Note for details. For the example screenshot, I intentionally deleted lines from one of the data backup files. Progress is shown per service (all services with persisted data) The SAP HANA database automatically deletes the internal snapshot from SAP HANA data area after it has been either confirmed or abandoned. Note: You can also call up the recovery wizard before transferring the storage snapshot to the data area of SAP HANA. In that case, the recovery wizard will show all storage snapshots recorded in the SAP HANA backup catalog, and you can decide which one to transfer to the data area of SAP HANA.After the recovery, SAP HANA automatically deletes the internal data snapshot from the data area (which was contained in the transferred storage snapshot). SSFS (SAP NetWeaver secure storage in the file system) is used by SAP HANA to storeThe root key for the data volume encryptionThe root key for the internal data protection API (DPAPI). Note: DPAPI is used by the secure internal credential store, which is needed in some scenarios such as smart data access to securely store additional user credentials (e.g. for access to remote systems) Note: For a recovery it might be necessary to manually configure additional services for added hosts. If this is the case, SAP HANA displays a message at the beginning of the recovery.