Vous êtes sur la page 1sur 23

IBM FlashCopy backup solution for

SAP HANA TDI


(Intel / IBM Power)
IBM SAP International Competence Center, IBM Germany

Location of this document:


http://www.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102476

isicc@de.ibm.com

Version 1.6 November 2016

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

Contents
1. Executive Summary............................................................................................. 2
2. Audience .............................................................................................................. 3
3. Backup concept for SAP HANA ........................................................................ 3
4. Supported HANA configuration ........................................................................ 3
5. Supported storage systems................................................................................ 3
6. Central Theme ..................................................................................................... 4
7. Naming convention ............................................................................................ 4
8. Setup of IBM Spectrum Virtualize / IBM Storwize family ................................. 6
9. Setup of LINUX systems ....................................................................................... 7
10. Preparation of SAP HANA .................................................................................. 8
11. Installation of IBM Spectrum Protect for ERP ................................................... 9
12. Preparation of FlashCopy backup script......................................................... 9
13. Backup best practices ..................................................................................... 12
14. FlashCopy restore .............................................................................................. 12
15. Recover the SAP HANA system ....................................................................... 13
16. Resources ........................................................................................................... 17
17. Notices ................................................................................................................ 17
18. Trademarks ......................................................................................................... 19
19. Sample Output .................................................................................................. 20

1. Executive Summary
Many customers seek solutions to fulfill the requirements of an industrialized
data center. The SAP HANA in-memory computing platform, along with
IBM Storage Systems, extends the possibilities for enterprises. These data
centers, including all SAP and non-SAP applications, must provide the following
fundamental characteristics:

Efficiently managed availability, capacity, performance, and the health


of the SAP landscape
High availability and application mobility
Data Protection and Disaster Recovery

Page - 2

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


This paper covers the last aspect, Data Protection and Disaster Recovery, and
introduced storage based backup (IBM FlashCopy) in combination with SAP
HANA SNAPSHOT to speed up the backup and recovery process from hours to
a few minutes.

2. Audience
This paper is intended as an architecture and configuration guide to setup IBM
Spectrum Virtualize (SVC or Storwize) and FlashCopy for SAP HANA TDI within
a SAN environment.
This document has been written for IT technical specialists and architects, with
advanced skill levels on SUSE Linux Enterprise Server, korn shell programming, and IBM Spectrum Virtualize (IBM SAN Volume Controller, SVC) or IBM
Storwize.

3. Backup concept for SAP HANA


IBM Spectrum Protect for Enterprise Resource Planning (TSM for ERP) protects
your vital SAP system data. It provides automated data protection designed
for SAP and SAP HANA environments, fully integrated with SAP ERP and SAP
HANA.
To reduce the time for the SAP backup, the online backup can be combined
with storage based backup via IBM FlashCopy. This can be achieved by using
the CLI (command line interface) of IBM Spectrum Virtualize (SVC or Storwize).
IBM FlashCopy delivers high levels of protection for key applications and databases using advanced integrated application snapshot backup and restore
capabilities. It lets you perform and manage frequent, near-instant, non-disruptive, application-aware backups and restores using integrated application.
The combination of both, online backup and FlashCopy, provides a high secure and fast way to protect SAP data bases, including SAP HANA.

4. Supported HANA configuration


The sample backup script runs on SAP HANA TDI solution based on SUSE SLES
or Red Hat -- on Intel and IBM Power platforms.

5. Supported storage systems


This script (tool) supports IBM Spectrum Virtualize (SVC), IBM FlashSystem V9000,
and IBM Storwize family; for HANA scale-up and HANA scale-out.
With the use of IBM SVC almost any SAN attached storage system - IBM as well
as non-IBM - can be used. See capability matrix of IBM SVC.

Page - 3

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

6. Central Theme
Assuming SAP is already installed, up, and running:
1. Setup ssh com between all HANA nodes; if not done already
2. Install Spectrum Protect for ERP (TSM for ERP/HANA)
3. Setup ssh com between the host the script is running on and Storwize
(SVC)
4. Define user friendly names (alias) for multipath
5. Create FlashCopy target Virtual Disks on Storwize (SVC)
6. Create SAP USERKEY for root on the first HANA node
7. Modify the parameters of the scripts to your needs

7. Naming convention
To easy setup and configuration, a strict use of naming convention is required.
The following syntax is used in this section:
<name> = <parameter>
SID
= ANA
If a name is serving as parameter then this is specified as

name
= %NAME%
SIDPATH = /usr/sap/%SID%
SIDPATH = /usr/sap/ANA

A consecutive number is identified with this sign: #


An associated number is identified with this sign: ?NAME?
It specifies that the same enumeration needs to be used as for NAME, e.g.
SV = Volume_#
TV = TARGET_?SV?

SV = Volume_3 Volume_4 Volume_5


TV = TARGET_3 TARGET_4 TARGET_5

_ means this character cannot be changed, because it a fundamental requirement by e.g. the Linux OS.
_ means this is the name to use, and if desired, it can be changed consistently.
_ indicates an example of associated numbers
/hana/shared/global.ini
partition_#_data__lvmname
= %VG_DATA%-%LV_DATA%
# alias for partition_#_data__lvmname = PD

Page - 4

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


partition_?PD?_log__lvmname
# alias for partition_#_log__lvmname

= %VG_LOG_%-%LV_LOG_%
= PL

Volume Group and Logical Volume names


VG_DATA
VG_LOG_
LV_DATA
LV_LOG_

=
=
=
=

VG_DATA_?PD?
VG_LOG_?PL?
LV_DATA_?VG_DATA?
LV_LOG_?VG_LOG_?

Please notice that the minus (hyphen) sign may not be part of the VG
or LV name, because it serves as tie sign for the multipath driver:
/dev/mapper/VGname-LVname
alias names in /etc/multipath.conf
(UUID_DATA) alias = %SID%_DATA_?VG_DATA?_#
(UUID_LOG_) alias = %SID%_LOG_?VG_LOG_?_#
Virtual Disk (VD) names on SVC
VD_DATA
VD_LOG_
VD_TARGET

= SAP_HANA_%SID%_DATA_?UUID_DATA?
= SAP_HANA_%SID%_LOG_?UUID_LOG_?
= %VD_DATA%_%TARGET_SETS%

Example:
Assuming the HANA system with SID:ANA is installed as scale out on
three nodes: host1, host2, host3.
Every DATA VG consists of two physical volumes (PV),
every LOG VG consists of one PV.
Four FlashCopy versions should be stored, therefor the parameter
TARGET_SETS has four entries.
TARGET_SETS=FC0 FC1 FC2 FC3

global.ini
partition_1_data__lvmname
partition_1_log__lvmname
partition_2_data__lvmname
partition_2_log__lvmname
partition_3_data__lvmname
partition_3_log__lvmname

=
=
=
=
=
=

VG_DATA_1-LV_DATA_1
VG_LOG_1-LV_LOG_1
VG_DATA_2-LV_DATA_2
VG_LOG_2-LV_LOG_2
VG_DATA_3-LV_DATA_3
VG_LOG_3-LV_LOG_3

/etc/multipath.conf (entries for HANA must be identical on all hosts)


alias = ANA_DATA_1_1
alias = ANA_DATA_1_2
alias = ANA_DATA_2_1
alias = ANA_DATA_2_2
Page - 5

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


alias = ANA_DATA_3_1
alias = ANA_DATA_3_2
alias = ANA_LOG_1_1
alias = ANA_LOG_2_1
alias = ANA_LOG_3_1
host 1
VG_DATA_1
VG_DATA_1
VG_LOG__1
VG_LOG__1

consists
hosts LV
consists
hosts LV

of PV ANA_DATA_1_1 & ANA_DATA_1_2


LV_DATA_1
of PV ANA_LOG_1_1
LV_LOG_1

host 2
VG_DATA_2 consists of PV ANA_DATA_2_1 & ANA_DATA_2_2
...
host 3
VG_DATA_3 consists of PV ANA_DATA_3_1 & ANA_DATA_3_2
....
VDISK names on SVC
SAP_HANA_ANA_DATA_1_1
SAP_HANA_ANA_DATA_1_1_FC0
SAP_HANA_ANA_DATA_1_1_FC1
SAP_HANA_ANA_DATA_1_1_FC2
SAP_HANA_ANA_DATA_1_1_FC3
SAP_HANA_ANA_DATA_1_2
SAP_HANA_ANA_DATA_1_2_FC0
SAP_HANA_ANA_DATA_1_2_FC1
SAP_HANA_ANA_DATA_1_2_FC2
SAP_HANA_ANA_DATA_1_2_FC3
SAP_HANA_ANA_LOG_1_1
SAP_HANA_ANA_DATA_2_1
...

= PV ANA_DATA_1_1

= PV ANA_DATA_1_2

= PV ANA_LOG__1_1
= PV ANA_DATA_2_1

8. Setup of IBM Spectrum Virtualize / IBM Storwize family


IBM SVC and IBM Storwize have the same user interface and the same commands (with some exception which do not matter here). Therefore both systems are just named as SVC.

Create the necessary Virtual Disks (VD) for DATA and LOG as thin provisioned volume svctask mkvdisk ...

Map these volumes to all hosts belonging to the HANA system, including stand-by nodes svctask mkvdiskhostmap force ...

Page - 6

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

Create the necessary Virtual Disks (VD) as target for DATA VD, also thin
provisioned. Do not map them to any host. svctask mkvdisk ...

The necessary FlashCopy Mapping and Consistency Groups will be created


and managed by the fc_backup.sh script.
Enable ssh communication through keys from all HANA nodes you want to run
the script on. Please notice that only the SVC user >admin< is capable to handle multiple keys from different hosts. Therefore, the scrip fc_backup.sh uses
only this user.

9. Setup of LINUX systems


Please pay attention to all SAP notes regarding HANA installation, in addition:

fc_backup.sh requires the use of Linux logical volume manager (LVM2)


fc_backup.sh requires that multipath is configured with user friendly
names (alias)
For every HANA DATA or LOG mount point one Linux volume group (VG)
with exactly one logical volume (LV) must be created.
The number of physical volumes (PV) does not matter for the flashcopy
function this is more a sizing / performance aspect.
The file system for HANA DATA and LOG must be of type xfs

Sample /etc/multipath.conf for IBM SVC / Storwize:


multipaths {
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
multipath
wwid
alias
}
}

Page - 7

{
360050768019382668800000000000208
ANA_DATA_1_1
{
360050768019382668800000000000209
ANA_DATA_1_2
{
36005076801938266880000000000020a
ANA_DATA_2_1
{
36005076801938266880000000000020b
ANA_DATA_2_2
{
36005076801938266880000000000020c
ANA_DATA_3_1
{
36005076801938266880000000000020d
ANA_DATA_3_2
{
360050768019382668800000000000231
LOG_1_1
{
360050768019382668800000000000232
LOG_2_1
{
360050768019382668800000000000233
LOG_3_1

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


Example steps to create a HANA file system for DATA:
pvcreate
pvcreate
vgcreate
lvcreate
mkfs.xfs

dataalignment 1m /dev/mapper/DATA_1_1
dataalignment 1m /dev/mapper/DATA_1_2
VG_DATA_1 /dev/mapper/DATA_1_1 /dev/mapper/DATA_1_2
-l -i2 -I 256k 100%VG -n LV_DATA_1 VG_DATA_1
-b size=4096 -s size=4096 /dev/mapper/VG_DATA_1-LV_DATA_1

Setup the shared file system for /hana/shared. Typically, this is done via NFS.
Please notice that all hosts, including the stand-by host(s) needs to be included, and available after boot.
Setup ssh communication though keys for root between all HANA nodes. Also
enable ssh communication to itself, which means running on Host nodeA:
nodeA# ssh root@nodeA

This is required by the script fc_backup.sh


Setup ssh between the host fc_backup.sh runs on and Storwize (SVC).

10. Preparation of SAP HANA


Please play attention to all necessary documentation from SAP.
Setup SAP user for backup Operation:
Define a new SAP user, grand BACKUP ADMIN to it, log in as the new user and
alter the password. You need to setup the USERSTORE to eliminate the need to
handle SAP password in plaintext. The USERSTORE needs to be set on very host
you want to run the backup script from.
Setup of /hana/shared/global.ini
Sample /hana/shared/global.ini with 3 worker nodes:
[communication]
listeninterface = .global
[persistence]
basepath_datavolumes = /hana/data/ANA
basepath_logvolumes = /hana/log/ANA
[storage]
ha_provider = hdb_ha.fcClientLVM
partition_*_*__prtype = 5
partition_1_data__lvmname = VG_DATA_1-LV_DATA_1
partition_1_log__lvmname = VG_LOG_1-LV_LOG_1
partition_2_data__lvmname = VG_DATA_2-LV_DATA_2
partition_2_log__lvmname = VG_LOG_2-LV_LOG_2
partition_3_data__lvmname = VG_DATA_3-LV_DATA_3
partition_3_log__lvmname = VG_LOG_3-LV_LOG_3

fc_backup.sh requires that the entries for partition... are ascending.

Page - 8

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

11. Installation of IBM Spectrum Protect for ERP


Please read the documentation:
Installation, configuration, and usage of IBM Spectrum Protect for Enterprise
Resource Planning:
http://www-01.ibm.com/support/docview.wss?uid=swg21963460
After the installation, you need to configure the DATA and LOG backup for the
HANA data base through the SAP HANA Studio:

Select the HANA system in the System view


Select Backup
Select Configuration
Select Backint in menu Log Backup Setting

Follow the procedure


12. Preparation of FlashCopy backup script
IBM provides this sample script AS IS without any warranty, of any kind either
expressed or implied. Use it on your own risk. Nevertheless, this script has been
tested with IBM SVC CLI (command line interface).
Currently, the backup script triggers a database backup using the CLI of IBM
SVC or Storwize in conjunction with the SAP HANA snapshot functionality, see
SAP HANA Administration Guide, section 4.2.11 Storage Snapshots.

Deployment
You can install the fc_backup.sh script on the HANA system, or on another
LINUX system, e.g. /hana/shared
If the script is installed on a remote host, then there is no need to place Storwize
into the same IP network with the HANA system; the Storwize can be placed in
a secondary network. Then the LINUX system hosting the scripts needs connection into both networks. Having two IP networks is a choice, but no requirement.

Page - 9

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

Parameterization
Before the backup script can be used, the parameterization must be adjusted.
Parameters must be given in the form:
<name>=<value>
Please note that there must not be any white space on either side of the =
operator. The name of parameters must not be changed. LINUX and this script
are case sensitive ! Many parameters refer to other parameters, for example in
path names or file names. In this case, the parameter referred to is denoted in
the form ${<name>}. As an example, the SAP System ID of the SAP HANA Database system is stored in a parameter named SID. The path at which the software executables of SAP HANA Database System with SAP System ID ANA are
installed is provided via a parameter SIDPATH:
SID=ANA
SIDPATH=/usr/sap/${SID}
All available parameters are described in the following sections. The first column of each parameter table denotes whether the parameter must be
changed:
means that the parameter must be adjusted to your installation
denotes a parameter that may be adjusted to you needs if so desired
means that typically this parameter refers to a default setting of SAP HANA
Database that is very unlikely to be changed in any database installation.

Parameters inside fc_backup.sh


Name

Default

LOG_LEVEL

BATCH

false

Page - 10

Description
Specifies the kind of messages to print:
0: no msg will be print, except errors
1: flow information
2: trace information
If set to true (lowercase) all message will
be saved in the log file, no output to
screen. Useful if the script is schedule e.g.
via cron.

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


SID

--

INSTANCE

--

SIDPATH

/usr/sap/${SID}

INSTPATH

${SIDPATH}/HDB
${INSTANCE}

SAP System ID of the SAP HANA


Database System
Instance number of the SAP HANA Database System
The directory into which the binaries of
the SAP HANA database system have
been installed
The directory containing the instance
data of the SAP HANA Database

HANA_SHARED

/hana/shared

The shared directory of HANA

FC_HOME

/hana/shared

USER_STORE_KEY

--

LOG_FILE (s)

1)

The home directory of the script, where to


place it
Specifies the entry in the User Store to be
used for authentication with the HANA
system.
Directory and file name of log file.

Specifies all hosts of this SAP Instance, including stand-by.


Specifies the host name / IP address of
SVC_HOST
-the SVC/Storwize system
Naming convention:
Specifies the postfix for the (FlashCopy tar TARGET_SETS
-get) VDISKs.
%TARGET=%SOURCE_%POSTFIX
Naming Convention:
FLASHCOPY_PREFIX
IBM_${SID}
Used for FlashCopy Mappings and Consistency Groups.
1) LOG_FILE=${FC_HOME}/log/$(basename $0)_${HOST}.log

NODE_LIST

--

Using the script fc_backup.sh


For online help run:
fc_backup.sh --man

Place the script in the /hana/shared directory.


Commands

Parameter

backup
restore

FlashCopy of a HANA data


ID

Restore of FLASHCOPY_SET through SVC CLI

ID

Displays all FlashCopy backup and the associated HANA Snapshot backup ID (SVC CLI)
For housekeeping purpose. Deletes the entry for the SNAPSHOT ID
in the HANA data base. This ID can be queried with the option
query
Just test the parameterization
No other function will be performed

Parameter

Description

query
delete
test

Options
USER_STORE
batch

Page - 11

Description

KEY

Overrides the parameter inside the script


Overrides the parameter inside the script

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


log_level

###

all

Overrides the parameter inside the script


Option for command delete. Deletes all SNAPSHOT entries with a
time stamp older than ID in the HANA data base.

Workflow of FlashCopy backup in fc_backup.sh


This is the principle workflow for a FlashCopy backup with IBM SVC CLI:
1. Identification of mount points: Mount Point LV VG PV VDISKS
2. Create HANA snapshot backup
3. Create temporary Consistency Group
4. Stop oldest FlashCopy Mapping
5. Add all mappings to the temporary Consistency Group
6. Sync all file systems
7. Start temporary Consistency Group
8. Remove temporary Consistency Group
9. Close the HANA snapshot as successful

13. Backup best practices


Use IBM Spectrum Protect for ERP (TSM for ERP) to backup DATA and LOG to
the TSM server. Use the script fc_backu.sh for additional FlashCopy protection,
which allows you to recover the DATA partitions in a few minutes rather than
waiting on DATA to be restored from TSM server. You should do a FlashCopy
backup at least once a day, best twice, or ever every 6 hours.
Any scheduler can be used to start the script.

14. FlashCopy restore


Identify the FlashCopy you want to use for restore by using the query commands, marked with green are the BACKUP_ID to be used for the command:
--restore=ID
./fc_backup.sh --query
HANA_BACKUP_ID
1475657616048
1475657489216
1475657074028
1475657035659

EXTERNAL_BACKUP_ID
IBM_ANA:FC3
IBM_ANA:FC2
IBM_ANA:FC1
IBM_ANA:FC0

Status
successful
successful
successful
successful

Comment
IBM-SVC-Backup
IBM-SVC-Backup
IBM-SVC-Backup
IBM-SVC-Backup

fc_backup.sh -restore=FC2

Output see section 19 Sample Output.

Page - 12

Copyright IBM Corporation 2016

Time Completed
2016-10-05_10:53:44
2016-10-05_10:51:38
2016-10-05_10:44:43
2016-10-05_10:44:04

IBM FlashCopy backup solution for SAP HANA TDI

15. Recover the SAP HANA system


Please read the SAP HANA admin guide how to recover the HANA database.

Right-click on the offline HANA system


Backup and Recovery Recover System ....

Next >

Page - 13

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

Next >

List will be empty; it will take some time to get the snapshot listed:

Page - 14

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

Next >

Next >

Page - 15

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

Finish

Page - 16

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

16. Resources
IBM System Storage Architecture and Configuration Guide for SAP HANA TDI
https://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102347

LINUX IO performance tuning for IBM System Storage


https://www-03.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/WP102584

IBM SAN Volume Controller SVC (IBM SVC)


http://www-03.ibm.com/systems/storage/software/virtualization/svc/index.html

IBM Tivoli Storage Manager for ERM, data protection for SAP HANA
http://www-01.ibm.com/support/knowledgecenter/SSZHVN_6.4.1/com.ibm.itsm.erp.doc/welcome.html

SAP HANA Platform Admin Guide


SAP note:
1651055 - Scheduling SAP HANA Database Backups in Linux
2039883 - FAQ: SAP HANA database and storage snapshots

17. Notices
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document
in other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any IBM intellectual property
Page - 17

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


right may be used instead. However, it is the user's responsibility to evaluate
and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not grant you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive, Armonk, NY
10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other
Country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Some states do not allow disclaimer of express or implied warranties in certain
transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors.
Changes are periodically made to the information herein; these changes will
be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in
this publication at any time without notice.
Any references in this information to non-IBM websites are provided for convenience only and do not in any manner serve as an endorsement of those
websites. The materials at those websites are not part of the materials for this
IBM product and use of those websites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without incurring any obligation to you.
Any performance data contained herein was determined in a controlled environment. Therefore, the results obtained in other operating environments
may vary significantly. Some measurements may have been made on development-level systems and there is no guarantee that these measurements will
be the same on generally available systems. Furthermore, some measurements
may have been estimated through extrapolation. Actual results may vary. Users of this document should verify the applicable data for their specific environment.
Information concerning non-IBM products was obtained from the suppliers of
those products, their published announcements or other publicly available
sources. IBM has not tested those products and cannot confirm the accuracy
of performance, compatibility or any other claims related to non-IBM products.
Questions on the capabilities of non-IBM products should be addressed to the
suppliers of those products.

Page - 18

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


This information contains examples of data and reports used in daily business
operations. To illustrate them as completely as possible, the examples include
the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses
used by an actual business enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language,
which illustrate programming techniques on various operating platforms. You
may copy, modify, and distribute these sample programs in any form without
payment to IBM, for the purposes of developing, using, marketing or distributing
application programs conforming to the application programming interface
for the operating platform for which the sample programs are written. These
examples have not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of these
programs.

18. Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of
International Business Machines Corporation in the United States, other countries, or both. These and other IBM trademarked terms are marked on their first
occurrence in this information with the appropriate symbol ( or ), indicating
US registered or common law trademarks owned by IBM at the time this information was published. Such trademarks may also be registered or common
law trademarks in other countries. A current list of IBM trademarks is available
on the Web at http://www.ibm.com/legal/copytrade.shtml
The following terms are trademarks of the International Business Machines Corporation in the United States, other countries, or both:
FlashCopy, FlashSystem, IBM, IBM FlashSystem, Storwize, System Storage
The following terms are trademarks of other companies:
SAP, and the SAP logo, HANA are trademarks of the SAP AG, Germany, other
countries, or both.
Other company, product, or service names may be trademarks or service
marks of others.

Page - 19

Copyright IBM Corporation 2016

19. Sample Output


Backup with Log Leve 1, scale out with two active HANA nodes; each DATA VG consists of two PV; four FlashCopy targets.
# ./fc_backup.sh -B
2016.10.05 10:53:14
2016.10.05 10:53:14
2016.10.05 10:53:20
2016.10.05 10:53:26
2016.10.05 10:53:36
2016.10.05 10:53:36
2016.10.05 10:53:36
2016.10.05 10:53:36
2016.10.05 10:53:36
2016.10.05 10:53:36
2016.10.05 10:53:37
2016.10.05 10:53:38
2016.10.05 10:53:38
2016.10.05 10:53:39
2016.10.05 10:53:40
2016.10.05 10:53:41
2016.10.05 10:53:41
2016.10.05 10:53:42
2016.10.05 10:53:42
2016.10.05 10:53:42
2016.10.05 10:53:44
2016.10.05 10:53:44
2016.10.05 10:53:44
2016.10.05 10:53:45
2016.10.05 10:53:44

Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:
Info_:

======================================================================
========= BACKUP STARTED =============================================
host:ph15na1 has mount point:/hana/data/ANA/mnt00001 and these VDISKs:M_DATA_1_2 M_DATA_1_2 -- PV:DATA_1_1 DATA_1_2
host:ph15na2 has mount point:/hana/data/ANA/mnt00002 and these VDISKs:M_DATA_2_1 M_DATA_2_2 -- PV:DATA_2_1 DATA_2_2
Using this FlashCopy target:FC3.
Creating HANA snapshot backup
BACKUP_ID in state PREPARED: 1475657616048
Creating SVC/Storwize FlashCopy backup
svctask mkfcconsistgrp -name IBM_ANA_FC3 -autodelete
svctask stopfcmap IBM_ANA_FC3_DATA_1_1
svctask stopfcmap IBM_ANA_FC3_DATA_1_2
svctask stopfcmap IBM_ANA_FC3_DATA_2_1
svctask stopfcmap IBM_ANA_FC3_DATA_2_2
svctask chfcmap -consistgrp IBM_ANA_FC3 -copyrate 0 -cleanrate 100 IBM_ANA_FC3_DATA_1_1
svctask chfcmap -consistgrp IBM_ANA_FC3 -copyrate 0 -cleanrate 100 IBM_ANA_FC3_DATA_1_2
svctask chfcmap -consistgrp IBM_ANA_FC3 -copyrate 0 -cleanrate 100 IBM_ANA_FC3_DATA_2_1
svctask chfcmap -consistgrp IBM_ANA_FC3 -copyrate 0 -cleanrate 100 IBM_ANA_FC3_DATA_2_2
syncing disks on ph15na1
syncing disks on ph15na2
Starting Consistency Group: IBM_ANA_FC3
Removed Consistency Group: IBM_ANA_FC3
New HANA BACKUP_ID: 1475657616048 with state SUCCESSFUL -- STORAGE_ID: IBM_ANA:FC3
========= BACKUP COMPLETED SUCCESSFULLY ==============================
Current number of SNAPSHOTs:5, MAX:4, going to delete ID:1475656961987
======================================================================

Backup with Log Leve 2:


# ./fc_backup.sh -B
2016.10.05 10:44:11
2016.10.05 10:44:11
2016.10.05 10:44:11
2016.10.05 10:44:15

Trace:
Info_:
Info_:
Trace:

init_() hdbsql can


flash_backup_svc()
flash_backup_svc()
query_DATA_VDISK()

2016.10.05
2016.10.05
2016.10.05
2016.10.05
2016.10.05
2016.10.05

Trace:
Trace:
Trace:
Trace:
Trace:
Info_:

query_DATA_VDISK()
query_DATA_VDISK()
query_DATA_VDISK()
query_DATA_VDISK()
query_DATA_VDISK()
query_DATA_VDISK()

10:44:15
10:44:16
10:44:16
10:44:16
10:44:17
10:44:17

connect to host:ph15na1.
======================================================================
========= BACKUP STARTED =============================================
ssh -n root@ph15na1 mount | grep vg_data_1-lv_data_1 | sed s:on:: |
sed s:/dev/disk/by-id/dm-name-:: | sed s:/dev/mapper/:: | awk { print \$1 \" \" \$2 }
Host:ph15na1, MP=/hana/data/ANA/mnt00001, LV=vg_data_1-lv_data_1, VG=vg_data_1.
ID:DATA_1_1 -- UUID:600507640081811fe8000000000008f5
SVC VD:M_DATA_1_1
ID:DATA_1_2 -- UUID:600507640081811fe8000000000008f6
SVC VD:M_DATA_1_1
host:ph15na1 has mount point:/hana/data/ANA/mnt00001 and these VDISKs:M_DATA_1_2 M_DATA_1_2 -PV:DATA_1_1 DATA_1_2

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


2016.10.05 10:44:21 Trace: query_DATA_VDISK() ssh -n root@ph15na2 mount | grep vg_data_1-lv_data_1 | sed s:on:: |
sed s:/dev/disk/by-id/dm-name-:: | sed s:/dev/mapper/:: | awk { print \$1 \" \" \$2 }
2016.10.05 10:44:21 Trace: query_DATA_VDISK() Nothing found
2016.10.05 10:44:21 Trace: query_DATA_VDISK() ssh -n root@ph15na2 mount | grep vg_data_2-lv_data_2 | sed s:on:: |
sed s:/dev/disk/by-id/dm-name-:: | sed s:/dev/mapper/:: | awk { print \$1 \" \" \$2 }
2016.10.05 10:44:21 Trace: query_DATA_VDISK() Host:ph15na2, MP=/hana/data/ANA/mnt00002, LV=vg_data_2-lv_data_2, VG=vg_data_2.
2016.10.05 10:44:23 Trace: query_DATA_VDISK() ID:DATA_2_1 -- UUID:600507640081811fe800000000000900
2016.10.05 10:44:23 Trace: query_DATA_VDISK() SVC VD:M_DATA_2_1
2016.10.05 10:44:23 Trace: query_DATA_VDISK() ID:DATA_2_2 -- UUID:600507640081811fe80000000000090b
2016.10.05 10:44:24 Trace: query_DATA_VDISK() SVC VD:M_DATA_2_2
2016.10.05 10:44:24 Info_: query_DATA_VDISK() host:ph15na2 has mount point:/hana/data/ANA/mnt00002 and these VDISKs:M_DATA_2_1 M_DATA_2_2 -PV:DATA_2_1 DATA_2_2
2016.10.05 10:44:33 Info_: check_mapping() Using this FlashCopy target:FC1.
2016.10.05 10:44:33 Trace: flash_backup_svc() Cleaning up HANA snapshot in state PREPARED
2016.10.05 10:44:33 Trace: snapshot_cleanup() snapshot_cleanup /usr/sap/ANA/HDB00/exe/hdbsql -U 001 -i 00 -j -a -x -n ph15na1 SELECT BACKUP_ID
FROM PUBLIC.M_BACKUP_CATALOG WHERE ENTRY_TYPE_NAME = 'data snapshot' AND STATE_NAME = 'prepared'
2016.10.05 10:44:34 Trace: snapshot_cleanup() No backup found in state PREPARED, ok.
2016.10.05 10:44:34 Info_: flash_backup_svc() Creating HANA snapshot backup
2016.10.05 10:44:34 Trace: snapshot_create() /usr/sap/ANA/HDB00/exe/hdbsql -U 001 -i 00 -j -a -x -n ph15na1 BACKUP DATA CREATE SNAPSHOT COMMENT
'IBM-SVC-Backup'
2016.10.05 10:44:34 Trace: snapshot_create() /usr/sap/ANA/HDB00/exe/hdbsql -U 001 -i 00 -j -a -x -n ph15na1 SELECT BACKUP_ID
FROM PUBLIC.M_BACKUP_CATALOG WHERE ENTRY_TYPE_NAME = 'data snapshot' AND STATE_NAME = 'prepared'
2016.10.05 10:44:34 Info_: flash_backup_svc() BACKUP_ID in state PREPARED: 1475657074028
2016.10.05 10:44:34 Info_: flash_backup_svc() Creating SVC/Storwize FlashCopy backup
2016.10.05 10:44:34 Info_: flashcopy_create_svc() svctask mkfcconsistgrp -name IBM_ANA_FC1 -autodelete
2016.10.05 10:44:35 Info_: flashcopy_create_svc() svctask stopfcmap IBM_ANA_FC1_DATA_1_1
2016.10.05 10:44:35 Info_: flashcopy_create_svc() svctask stopfcmap IBM_ANA_FC1_DATA_1_2
2016.10.05 10:44:36 Info_: flashcopy_create_svc() svctask stopfcmap IBM_ANA_FC1_DATA_2_1
2016.10.05 10:44:36 Info_: flashcopy_create_svc() svctask stopfcmap IBM_ANA_FC1_DATA_2_2
2016.10.05 10:44:37 Info_: flashcopy_create_svc() svctask chfcmap -consistgrp IBM_ANA_FC1 -copyrate 0 -cleanrate 100 IBM_ANA_FC1_DATA_1_1
2016.10.05 10:44:38 Info_: flashcopy_create_svc() svctask chfcmap -consistgrp IBM_ANA_FC1 -copyrate 0 -cleanrate 100 IBM_ANA_FC1_DATA_1_2
2016.10.05 10:44:39 Info_: flashcopy_create_svc() svctask chfcmap -consistgrp IBM_ANA_FC1 -copyrate 0 -cleanrate 100 IBM_ANA_FC1_DATA_2_1
2016.10.05 10:44:40 Info_: flashcopy_create_svc() svctask chfcmap -consistgrp IBM_ANA_FC1 -copyrate 0 -cleanrate 100 IBM_ANA_FC1_DATA_2_2
2016.10.05 10:44:40 Info_: flashcopy_create_svc() syncing disks on ph15na1
2016.10.05 10:44:41 Info_: flashcopy_create_svc() syncing disks on ph15na2
2016.10.05 10:44:41 Info_: flashcopy_create_svc() Starting Consistency Group: IBM_ANA_FC1
2016.10.05 10:44:43 Info_: flashcopy_create_svc() Removed Consistency Group: IBM_ANA_FC1
2016.10.05 10:44:43 Trace: flash_backup_svc() Closing BACKUP_ID: 1475657074028 with state SUCCESSFUL -- STORAGE_ID : IBM_ANA:FC1
2016.10.05 10:44:43 Trace: snapshot_close() 1475657074028 /usr/sap/ANA/HDB00/exe/hdbsql -U 001 -i 00 -j -a -x -n ph15na1 BACKUP DATA CLOSE
SNAPSHOT BACKUP_ID 1475657074028 SUCCESSFUL 'IBM_ANA:FC1'
2016.10.05 10:44:43 Info_: flash_backup_svc() New HANA BACKUP_ID: 1475657074028 with state SUCCESSFUL -- STORAGE_ID: IBM_ANA:FC1
2016.10.05 10:44:43 Info_: flash_backup_svc() ========= BACKUP COMPLETED SUCCESSFULLY ==============================
2016.10.05 10:44:44 Info_: flash_backup_svc() Current number of SNAPSHOTs:5, MAX:4, going to delete ID:1475656869382
2016.10.05 10:44:44 Trace: snapshot_delete() /usr/sap/ANA/HDB00/exe/hdbsql -U 001 -i 00 -j -a -x -n ph15na1 BACKUP CATALOG DELETE
BACKUP_ID 1475656869382 COMPLETE
2016.10.05 10:44:43 Info_: flash_backup_svc() ======================================================================

Page - 21

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI

# ./fc_backup.sh -Q
HANA_BACKUP_ID EXTERNAL_BACKUP_ID
1475657616048
IBM_ANA:FC3
1475657489216
IBM_ANA:FC2
1475657074028
IBM_ANA:FC1
1475657035659
IBM_ANA:FC0

Status
successful
successful
successful
successful

Comment
IBM-SVC-Backup
IBM-SVC-Backup
IBM-SVC-Backup
IBM-SVC-Backup

Time Completed
2016-10-05_10:53:44
2016-10-05_10:51:38
2016-10-05_10:44:43
2016-10-05_10:44:04

./fc_backup.sh -R FC2
2016.10.05 14:46:39 Info_: Starting SVC CLI FlashCopy restore with TARGET FC2.
2016.10.05 14:46:41 Info_: svctask mkfcconsistgrp -name IBM_ANA_FC2_R -autodelete
2016.10.05 14:46:42 Info_: svctask mkfcmap -source M_DATA_1_1_FC2 -target M_DATA_1_1 -name IBM_ANA_FC2_DATA_1_1_R
-consistgrp IBM_ANA_FC2_R -copyrate 100 -cleanrate 100 -autodelete
2016.10.05 14:46:44 Info_: svctask mkfcmap -source M_DATA_1_2_FC2 -target M_DATA_1_2 -name IBM_ANA_FC2_DATA_1_2_R
-consistgrp IBM_ANA_FC2_R -copyrate 100 -cleanrate 100 -autodelete
2016.10.05 14:46:46 Info_: svctask mkfcmap -source M_DATA_2_1_FC2 -target M_DATA_2_1 -name IBM_ANA_FC2_DATA_2_1_R
-consistgrp IBM_ANA_FC2_R -copyrate 100 -cleanrate 100 -autodelete
2016.10.05 14:46:48 Info_: svctask mkfcmap -source M_DATA_2_2_FC2 -target M_DATA_2_2 -name IBM_ANA_FC2_DATA_2_2_R
-consistgrp IBM_ANA_FC2_R -copyrate 100 -cleanrate 100 -autodelete
2016.10.05 14:46:50 Info_: ph15na1 umount /dev/mapper/vg_data_1-lv_data_1 ... successful
2016.10.05 14:46:51 Info_: ph15na2 umount /dev/mapper/vg_data_2-lv_data_2 ... successful
2016.10.05 14:46:52 Info_: svctask startfcconsistgrp -prep -restore IBM_ANA_FC2_R
2016.10.05 14:46:56 Info_: ph15na1 mount /dev/mapper/vg_data_1-lv_data_1 /hana/data/ANA/mnt00001 ... successful
2016.10.05 14:46:59 Info_: ph15na2 mount /dev/mapper/vg_data_2-lv_data_2 /hana/data/ANA/mnt00002 ... successful
2016.10.05 14:46:59 Info_: SVC CLI FlashCopy completed successful for TARGET FC2.
# ./fc_backup.sh -T
SID .......................................................................... ANA
INSTANCE ...................................................................... 00
HDBSQL ............ /usr/sap/ANA/HDB00/exe/hdbsql -U 001 -i 00 -j -a -x -n ph15na1
Status of HANA data base ................................................. ON line
TARGET_SETS ...................................................... FC0 FC1 FC2 FC3
host:ph15na1 has this mount point ........................ /hana/data/ANA/mnt00001
with these PV ....................................................... DATA_1_1
VD ..................................................... M_DATA_1_1
....................................................... DATA_1_2
..................................................... M_DATA_1_2
host:ph15na2 has this mount point ........................ /hana/data/ANA/mnt00002
with these PV ....................................................... DATA_2_1
VD ..................................................... M_DATA_2_1
....................................................... DATA_2_2
..................................................... M_DATA_2_2
Source VD has these targets
IBM_ANA_FC0_DATA_1_1 ==>
IBM_ANA_FC1_DATA_1_1 ==>
IBM_ANA_FC2_DATA_1_1 ==>
IBM_ANA_FC3_DATA_1_1 ==>

with mappings ............................. M_DATA_1_1


....................................... M_DATA_1_1_FC0
....................................... M_DATA_1_1_FC1
....................................... M_DATA_1_1_FC2
....................................... M_DATA_1_1_FC3

Page - 22

Copyright IBM Corporation 2016

IBM FlashCopy backup solution for SAP HANA TDI


Source VD has these targets
IBM_ANA_FC0_DATA_1_2 ==>
IBM_ANA_FC1_DATA_1_2 ==>
IBM_ANA_FC2_DATA_1_2 ==>
IBM_ANA_FC3_DATA_1_2 ==>

with mappings ............................. M_DATA_1_2


....................................... M_DATA_1_2_FC0
....................................... M_DATA_1_2_FC1
....................................... M_DATA_1_2_FC2
....................................... M_DATA_1_2_FC3

Source VD has these targets


IBM_ANA_FC0_DATA_2_1 ==>
IBM_ANA_FC1_DATA_2_1 ==>
IBM_ANA_FC2_DATA_2_1 ==>
IBM_ANA_FC3_DATA_2_1 ==>

with mappings ............................. M_DATA_2_1


....................................... M_DATA_2_1_FC0
....................................... M_DATA_2_1_FC1
....................................... M_DATA_2_1_FC2
....................................... M_DATA_2_1_FC3

Source VD has these targets


IBM_ANA_FC0_DATA_2_2 ==>
IBM_ANA_FC1_DATA_2_2 ==>
IBM_ANA_FC2_DATA_2_2 ==>
IBM_ANA_FC3_DATA_2_2 ==>

with mappings ............................. M_DATA_2_2


....................................... M_DATA_2_2_FC0
....................................... M_DATA_2_2_FC1
....................................... M_DATA_2_2_FC2
....................................... M_DATA_2_2_FC3

Page - 23

Copyright IBM Corporation 2016

Vous aimerez peut-être aussi