Back and Restore For HANA System Relication
Back and Restore For HANA System Relication
Abstract
This document describes how NetApp® SnapCenter® technology and the SAP HANA plug-in
can be used for backup and recovery in an SAP HANA System Replication environment.
TABLE OF CONTENTS
5.2 Restore and Recovery with Separate SnapCenter Resources Configuration .................................... 17
5.3 Restore and Recovery with a Single SnapCenter Resource Configuration ....................................... 18
5.4 Restore and Recovery from a Backup Created at the Other Host ..................................................... 23
2 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
LIST OF FIGURES
Figure 1) SAP System Replication as a high-availability solution. ............................................................................ 4
Figure 2) SAP System Replication as a disaster recovery solution. ......................................................................... 5
Figure 3) Backup operation with SAP System Replication. ...................................................................................... 5
Figure 4) Restore operation with SAP System Replication....................................................................................... 6
Figure 5) SnapCenter configuration options for SAP System Replication. ............................................................... 6
Figure 6) Backup operation with host 1 as the primary host. .................................................................................... 7
Figure 7) Backup operation with host 2 as the primary host. .................................................................................... 8
Figure 8) Data and log backup housekeeping. ......................................................................................................... 8
Figure 9) Backup operation with host 1 as the primary host. .................................................................................... 9
Figure 10) Backup operation with host 2 as the primary host. ................................................................................ 10
Figure 11) Identification of the backup host. ........................................................................................................... 10
Figure 12) Summary of configuration options. ........................................................................................................ 11
Figure 13) Lab setup: SnapCenter with separate resources. ................................................................................. 12
Figure 14) Maintenance mode activation. ............................................................................................................... 12
Figure 15) Lab setup for SnapCenter with a single resource. ................................................................................ 13
Figure 16) SnapCenter resource configuration. ...................................................................................................... 14
Figure 17) SnapCenter resource configuration: storage footprint. .......................................................................... 14
Figure 18) Resource protection configuration. ........................................................................................................ 15
Figure 19) Backup job log with host 1 as the primary host. .................................................................................... 15
Figure 20) Backup job log with host 2 as the primary host. .................................................................................... 16
Figure 21) SAP HANA backup catalog. .................................................................................................................. 16
Figure 22) Overview of restore and recovery operations. ....................................................................................... 17
Figure 23) Restore operations with a single SnapCenter resource configuration. ................................................. 18
Figure 24) SnapCenter restore of the valid backup only......................................................................................... 19
Figure 25) SAP HANA Studio before the restore operation. ................................................................................... 19
Figure 26 Restore and recovery with SAP HANA Studio........................................................................................ 20
Figure 27) File-level restore with SnapCenter. ....................................................................................................... 20
Figure 28) Backup and log backup selection. ......................................................................................................... 21
Figure 29) Start of secondary host and resynchronization. .................................................................................... 21
Figure 30) SnapCenter restore of valid backup and crash image. ......................................................................... 22
Figure 31) Complete resource restore operation. ................................................................................................... 22
Figure 32) Start of secondary host and resynchronization. .................................................................................... 23
Figure 33) Restore and recovery from a backup created at the other host. ........................................................... 23
Figure 34) SAP HANA Studio before restore operation. ......................................................................................... 24
Figure 35) SnapCenter clone workflow. .................................................................................................................. 25
Figure 36) Junction path information. ..................................................................................................................... 25
3 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
1 SAP HANA System Replication Overview
SAP HANA System Replication is commonly used as a high-availability or disaster recovery solution
for SAP HANA databases. SAP HANA System Replication provides different operating modes that
you can use depending on the use case or availability requirements.
There are two primary use cases that can also be combined:
• High availability with a recovery point objective (RPO) of zero and a minimal recovery time
objective (RTO).
• Disaster recovery over a large distance. The secondary SAP HANA host can also be used for
development or testing during normal operation.
4 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 2) SAP System Replication as a disaster recovery solution.
When a failover is performed for host 2, the backups are executed at host 2 and Snapshot copies are
created at the storage volume of host 2.
The backup created at host 2 can be restored directly at the storage layer. If you must use a backup
created at host 1, then the backup must be copied from the host 1 storage volume to the host 2
storage volume. Forward recovery uses the log backups from both hosts.
Figure 4 shows an overview of the two different restore operations.
5 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 4) Restore operation with SAP System Replication.
With separate resources for each SAP HANA host, SnapCenter is configured in the same way as with
SAP HANA hosts without SAP System Replication. Each host is configured using its physical IP
address (host name) and its individual data volume on the storage layer. Scheduled backup
operations are activated and deactivated in SnapCenter, depending on which host is primary or
secondary.
With a single-resource configuration for both SAP HANA hosts, the SnapCenter resource is
configured using the virtual IP address of the SAP HANA System Replication hosts. Both data
volumes of the SAP HANA hosts are included in the SnapCenter resource.
6 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
The two options are discussed in more detail in the following sections.
Figure 7 shows the backup operation after a failover to host 2 and a replication from host 2 to host 1.
As part of the SAP HANA System Replication failover workflow, you must put the SnapCenter
resource for host 1 in maintenance mode, and you must put the resource of host 2 in production
mode. Backups are now executed at host 2, and Snapshot copies are created at the data volume of
host 2. The SAP HANA backup catalog now includes a backup that has been created at host 1, and
another backup is created at host 2. The SnapCenter resource for host 2 includes only the backup
created at host 2.
As discussed in the section “Storage Snapshot Backups and SAP System Replication,” the restore
operation with storage-based Snapshot backups is different, depending on which backup needs to be
restored. It is important to identify where the backup was created to determine whether the restore
can be performed at the local storage volume or must be performed from the other host’s storage
volume. With two separate SnapCenter resources, this identification is performed on the SnapCenter
resource level.
7 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 7) Backup operation with host 2 as the primary host.
The housekeeping of data backups, based on the retention policy defined in SnapCenter, is done only
for the backups of the active SnapCenter resource. As Figure 8 shows, the backup that was created
at host 1 is not deleted as long as host 2 is the active resource. Therefore, the backup from host 1
becomes the oldest backup, and all log backups that are required for forward recovery of this backup
are not deleted.
To clean up Snapshot copies on the data volume of host 1 and to clean up log backups, you must
delete the data backup of host 1 manually in SnapCenter and the SAP HANA backup catalog.
8 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Note: We assume that the virtual IP address is always bound to the primary SAP HANA host. The
failover of the virtual IP address is performed outside SnapCenter as part of the SAP System
Replication failover workflow.
When a backup is executed with host 1 as the primary host, a database-consistent Snapshot backup
is created at the data volume of host 1. Because the data volume of host 2 is part of the SnapCenter
resource, another Snapshot copy is created for this volume. This Snapshot copy is not database
consistent; rather, it is just a crash image of the secondary host.
The SAP HANA backup catalog and the SnapCenter resource includes the backup created at host 1.
Error! Reference source not found. shows the backup operation after failover to host 2 and r
eplication from host 2 to host 1. SnapCenter automatically communicates with host 2 by using the
virtual IP address configured in the SnapCenter resource. Backups are now created at host 2. Two
Snapshot copies are created by SnapCenter: a database-consistent backup at the data volume at
host 2 and a crash image Snapshot copy at the data volume at host 1. The SAP HANA backup
catalog and the SnapCenter resource now include the backup created at host 1 and the backup
created at host 2.
Housekeeping of data and log backups is based on the defined SnapCenter retention policy, and
backups are deleted regardless of which host is primary or secondary.
9 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 10) Backup operation with host 2 as the primary host.
As discussed in the section “Storage Snapshot Backups and SAP System Replication,” a restore
operation with storage-based Snapshot backups is different, depending on which backup must be
restored. It is important to identify which host the backup was created at to determine if the restore
can be performed at the local storage volume, or if the restore must be performed at the other host’s
storage volume.
With a single-resource SnapCenter configuration, SnapCenter is not aware of where the backup was
created. Therefore, NetApp recommends that you add a prebackup script to the SnapCenter backup
workflow to identify which host is currently the primary SAP HANA host.
3.3 Summary
Figure 12 summarizes the pros and cons of the two configuration options.
10 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 12) Summary of configuration options.
SnapCenter Configuration
Figure 13 shows the lab setup and an overview of the required NetApp SnapCenter configuration.
11 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 13) Lab setup: SnapCenter with separate resources.
To configure SnapCenter with separate resources, the SAP HANA plug-in must be deployed on each
SAP HANA host.
Note: SnapCenter uses the security identifier (SID), the tenant name, and the hdbsql client host as
a unique resource identifier. Since the SID and the tenant name are identical for the system
replication resources, the hdb client host must be different. Therefore, a central
communication host cannot be used.
The configuration of both resources is identical to a non–system replication setup and is described in
the technical report SAP HANA Backup and Recovery with SnapCenter.
Backup operations are performed as usual. If an SAP HANA System Replication failover occurs, the
old primary resource must be put into maintenance mode, and the old secondary resource must be
put into production mode.
After failover, SnapCenter does not delete the backups and SAP HANA catalog entries of the inactive
resource. You must delete these backups manually in SnapCenter and the SAP HANA backup
catalog to make sure that log backup housekeeping is not blocked by the old backup of the inactive
resource.
12 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
4.2 Backup Operation with a Single SnapCenter Resource
SnapCenter Configuration
Figure 15 shows the lab setup and an overview of the required SnapCenter configuration.
To perform backup operations regardless of which SAP HANA host is primary and even whether one
host is down, the SnapCenter SAP HANA plug-in must be deployed on a central hdbsql
communication host. In our lab setup, we used the SnapCenter server as a central communication
host, and we deployed the SAP HANA plug-in on the SnapCenter server.
A user was created in the HANA database to perform backup operations. A user store key was
configured at the SnapCenter server on which the SAP HANA plug-in was installed. The user store
key includes the virtual IP address of the SAP HANA System Replication hosts (ssr-vip).
hdbuserstore.exe -u SYSTEM set SSRKEY ssr-vip:31013 SNAPCENTER Netapp123
You can find more information about SAP HANA plug-in deployment options and user store
configuration in the technical report TR-4614: SAP HANA Backup and Recovery with SnapCenter.
In SnapCenter, the resource is configured as shown in Figure 16 using the user store key, configured
before, and the SnapCenter server as the hdbsql communication host.
13 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 16) SnapCenter resource configuration.
The data volumes of both SAP HANA hosts are included in the storage footprint configuration as
Figure 17 shows.
As discussed in the section “SnapCenter Configuration with a Single Resource,” SnapCenter is not
aware of where the backup was created. NetApp therefore recommends that you add a prebackup
script in the SnapCenter backup workflow to identify which host is currently the primary SAP HANA
host. You can perform this identification using a SQL statement that is added to the backup workflow,
as Figure 18 shows.
Select host from “SYS”.M_DATABASE
14 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 18) Resource protection configuration.
Figure 19) Backup job log with host 1 as the primary host.
15 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 20) Backup job log with host 2 as the primary host.
Figure 21 shows the SAP HANA backup catalog in SAP HANA Studio. When the SAP HANA
database is online, the SAP HANA host where the backup was created is visible in SAP HANA
Studio.
Note: The SAP HANA backup catalog on the file system, which is used during a restore and
recovery operation, does not include the host name where the backup was created. The only
way to identify the host when the database is down is to combine the backup catalog entries
with the backup.log file of both SAP HANA hosts.
16 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
5 Restore and Recovery
17 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
A restore operation from a backup that was created at the other host is described in the section
“Restore and Recovery from a Backup Created at the Other Host.”
18 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 24) SnapCenter restore of the valid backup only.
Figure 25 shows the SAP HANA backup catalog in SAP HANA Studio. The highlighted backup shows
the backup created at T1 at host 1.
A restore and recovery operation is started in SAP HANA Studio. As Figure 26 shows, the name of
the host where the backup was created is not visible in the restore and recovery workflow.
Note: In our test scenario, we were able to identify the correct backup (the backup created at host
1) in SAP HANA Studio when the database was still online. If the database is not available,
you must check the SnapCenter backup job log to identify the right backup.
19 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 26 Restore and recovery with SAP HANA Studio.
In SnapCenter, the backup is selected and a file-level restore operation is performed. On the file-level
restore screen, only the host 1 volume is selected so that only the valid backup is restored.
After the restore operation, the backup is highlighted in green in SAP HANA Studio. You don’t have to
enter an additional log backup location, because the file path of log backups of host 1 and host 2 are
included in the backup catalog.
20 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 28) Backup and log backup selection.
After forward recovery has finished, the secondary host (host 2) is started and SAP HANA System
Replication resynchronization is started.
Note: Even though the secondary host is up-to-date (no restore operation was performed for host
2), SAP HANA executes a full replication of all data. This behavior is standard after a restore
and recovery operation with SAP HANA System Replication.
21 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 30) SnapCenter restore of valid backup and crash image.
The restore and recovery operation with SAP HANA Studio is identical to the steps described in the
section “SnapCenter Restore of the Valid Backup Only.”
To perform the restore operation, select Complete Resource in SnapCenter. The volumes of both
hosts are restored.
After forward recovery has been completed, the secondary host (host 2) is started and SAP HANA
System Replication resynchronization is started. Full replication of all data is executed.
22 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 32) Start of secondary host and resynchronization.
5.4 Restore and Recovery from a Backup Created at the Other Host
A restore operation from a backup that has been created at the other SAP HANA host is a valid
scenario for both SnapCenter configuration options.
Figure 33 shows an overview of the restore and recovery scenario described in this section.
A backup has been created at T1 at host 1. A failover has been performed to host 2. At the current
point in time, host 2 is the primary host.
1. A failure occurred and you must restore to the backup created at T1 at host 1.
2. The primary host (host 1) is shut down.
3. The backup data T1 of host 1 is restored to host 2.
4. A forward recovery is performed using logs from host 1 and host 2.
5. Host 1 is started, and a system replication resynchronization of host 1 is automatically started.
Figure 33) Restore and recovery from a backup created at the other host.
Figure 34 shows the SAP HANA backup catalog and highlights the backup, created at host 1, that
was used for the restore and recovery operation.
23 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Figure 34) SAP HANA Studio before restore operation.
You must provide the clone server and the NFS export IP address.
Note: In a SnapCenter single-resource configuration, the SAP HANA plug-in is not installed at the
database host. To execute the SnapCenter clone workflow, any host with an installed HANA
plug-in can be used as a clone server.
24 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
In a SnapCenter configuration with separate resources, the HANA database host is selected
as a clone server, and a mount script is used to mount the clone to the target host.
To determine the junction path that is required to mount the cloned volume, check the job log of the
cloning job, as Figure 36 shows.
25 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
drwx------ 2 ssradm sapsys 4096 Jun 27 11:12 hdb00003.00003
-rw-r--r-- 1 ssradm sapsys 22 Jun 27 11:12 nameserver.lck
The recovery with SAP HANA Studio is performed as described in the section “SnapCenter Restore of
the Valid Backup Only.”
Version History
Version Date Document Version History
Version 1.0 October Initial version
26 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.
Refer to the Interoperability Matrix Tool (IMT) on the NetApp Support site to validate that the exact
product and feature versions described in this document are supported for your specific environment.
The NetApp IMT defines the product components and versions that can be used to construct
configurations that are supported by NetApp. Specific results depend on each customer’s installation
in accordance with published specifications.
Copyright Information
Copyright © 2018 NetApp, Inc. All rights reserved. Printed in the U.S. No part of this document
covered by copyright may be reproduced in any form or by any means—graphic, electronic, or
mechanical, including photocopying, recording, taping, or storage in an electronic retrieval system—
without prior written permission of the copyright owner.
Software derived from copyrighted NetApp material is subject to the following license and disclaimer:
THIS SOFTWARE IS PROVIDED BY NETAPP “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WHICH ARE HEREBY
DISCLAIMED. IN NO EVENT SHALL NETAPP BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NetApp reserves the right to change any products described herein at any time, and without notice.
NetApp assumes no responsibility or liability arising from the use of products described herein, except
as expressly agreed to in writing by NetApp. The use or purchase of this product does not convey a
license under any patent rights, trademark rights, or any other intellectual property rights of NetApp.
The product described in this manual may be protected by one or more U.S. patents, foreign patents,
or pending applications.
RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the government is subject to
restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252.277-7103 (October 1988) and FAR 52-227-19 (June 1987).
Trademark Information
NETAPP, the NETAPP logo, and the marks listed at http://www.netapp.com/TM are trademarks of
NetApp, Inc. Other company and product names may be trademarks of their respective owners.
27 SAP HANA System Replication: Backup and Recovery with SnapCenter © 2018 NetApp, Inc. All rights reserved.