You are on page 1of 8

Technical Documentation

Figure 2: Sample GRUB boot loader screen

Once the backup partition is booted, run the following command to transfer the backup to the original
root partition:
# Begin restore of root file system
rsync -aAXxv --delete / /var/backup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/boot/efi*,/run/*,/mnt/*,/media/*,\
/lost+found,/var/backup/*,/sapmnt/*,/var/lib/ntp/proc/*,/etc/fstab}
middle_stamp=$(date +%s)
echo "Root file system completed in $( echo \
"(${middle_stamp}-${start_stamp})/60"| bc ) minutes $( echo "(${middle_stamp}-${start_stamp})%60"| bc ) seconds"
# Begin restore of /boot/efi file system
rsync -aAXxv --delete /boot/efi/ /var/backup/boot/efi/
end_stamp=$(date +%s)
echo "Boot file system completed in $( echo \
"(${end_stamp}-${start_stamp})/60"| bc ) minutes $( echo "(${end_stamp}-${start_stamp})%60"| bc ) seconds"

Listing 17: Example rsync command

Then you need to revert the changes made in 2.1.4: Backup Procedure on page 12: Swap the mountpoints
of \ and \boot\efi with the original root partition in the /var/backup/etc/fstab.
## Adding entries for HANA System Backup
/dev/disk/by-id/scsi-3600605b0038ac2601a9a1f01cc74cf23-part1 /boot/efi vfat umask=0002,utf8=true 0 0
/dev/disk/by-id/scsi-3600605b0038ac2601a9a1f01cc74cf23-part2 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/scsi-3600605b0038ac2601a9a1f01cc74cf23-part3 swap swap defaults 0 0
/dev/disk/by-id/scsi-3600605b0038ac2601a9a1f01cc74cf23-part4 /var/backup/boot/efi vfat umask=0002,utf8=true 0 0
/dev/disk/by-id/scsi-3600605b0038ac2601a9a1f01cc74cf23-part5 /var/backup/root ext3 acl,user_xattr 1 1

Listing 18: Example SLES primary fstab file

## Adding entries for HANA System Backup


LABEL=hanaboot /boot/efi vfat umask=0002,utf8=true 0 0
LABEL=hanaroot / ext3 acl,user_xattr 1 1
LABEL=hanaswap swap swap defaults 0 0
LABEL=backboot /var/backup/boot/efi vfat umask=0002,utf8=true 0 0
LABEL=backroot /var/backup/root ext3 acl,user_xattr 1 1
Listing 19: Example RHEL primary fstab file

Warning
Be careful after using the rsync command to pay attention to the files /var/backup/etc/
fstab and the boot loaders /var/backup/boot/grub/grub.cfg or /var/backup/etc/elilo.
conf. Ensure that they have the reverse meaning to that described in the previous section.
On the primary partition, you should now be able to boot into the primary partition using the boot
loaders default menu item.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 18
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

3 SAP HANA Backup and Disaster Recovery


The Lenovo Solution supports two file system types which store the SAP HANA Platform Edition data,
log and shared file systems: IBM® Spectrum Scale® (GPFS!13 ®) and XFS. The methods to backup and
recover from each of these file systems are different and require different tools. What follows are sections
for each file system.

3.1 XFS Backup

For single node setups, the simplest way to backup the SAP HANA data, log and shared file systems
is to follow the section "SAP HANA Database Backup and Recovery" which can be found in the SAP
HANA Administration Guide on the SAP HANA Help Portal. A generic overview of how to backup
and restore the SAP HANA database can be found in SAP SCN — SAP HANA Backup/Recovery
Overview.
Lenovo does not support clustered solutions using the XFS file system, although in a Tailored Datacenter
Integration approach, it is possible using a third party’s storage system. If this is the case, you should
adhere to the recommendations of the storage provider how to best store and recovery backups of the
operating and SAP HANA file systems.

3.2 IBM Spectrum Scale Backup

This section provides instructions necessary to create a simple SAP HANA backup and restore procedure.
These images can then be used for a basic backup/restore solution. Initially, they are copied locally and
must be transferred to an offline storage for any real use. The intent is that the user can have a simple
backup and restore solution using the tools available with IBM GPFS and SAP HANA. For advanced
backup and restore solutions, we recommend to use an enterprise backup solution to ensure backup/
restore operations for IBM GPFS and SAP HANA.
What follows is a description how to take snapshots of the IBM GPFS file system and the SAP HANA
database. We also describe how to restore SAP HANA in case of a planned or unplanned disaster. This
enables the administrator to take backups of the SAP HANA data without interrupting the database
service (so called online backups of the database). The time it takes to actually backup the data afterwards
to a secure place does not affect SAP HANA operation.
Note
Features from SAP HANA Studio for snapshot generation are described as well. Identical
results can be achieved using the command-line SQL interface found in the SAP HANA guide
books.

3.3 Description

The procedure to backup SAP HANA and IBM GPFS only apply to SAP HANA 1.0 SPS 07 and later.
These instructions are also included in the SAP HANA Operations Guide. All screenshots were taken
with this release. The GUI may change with newer releases.
• This procedure can restore data:
– on the very same environment the snapshot was taken from,
– on an environment that copies the landscape of the original system.
13 GPFS!

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 19
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

• A change in landscape (m–to–n copy) is not supported.


• Make sure to always check the following locations for latest information:
– http://help.sap.com/hana/SAP_HANA_Administration_Guide_en.pdfSAP HANA Admin-
istration Guide, Chapter: Backup and Recovery,
– http://www.saphana.com/docs/DOC-1220SAP HANA Backup and Recovery Overview,
– IBM GPFS snapshot http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/
com.ibm.cluster.IBMGPFS.v4r1.IBMGPFS200.doc/bl1adv_logcopy.htmdocumentation.

Warning
Do not go into production without verifying a full backup and restore procedure!

3.4 Backup of SAP HANA

Open SAP HANA Studio.

In SAP HANA Studio either right-click on Backup and choose "Manage Storage Snapshots" from the
context menu or click on "Storage Snapshots" on the right. This allows to generate a snapshot. The
following dialog opens:

Click on “Prepare”. You are then asked to give this snapshot a name. This name will be stored in the
SAP HANA backup catalog. It does not appear outside of SAP HANA.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 20
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

After clicking the OK button the snapshot is generated. Any log entries are merged into the data area
so that it has a consistent state that can be recovered from.

While the snapshot is active you can not have further snapshots or backups taken from this SAP HANA
instance. Notice file snapshot_databackup_0_1 in /sapmnt/data/<SID>/mnt00001/hdb00001 – this file
indicates that the content of this directory is a valid SAP HANA snapshot and can be used to recover
from.
The next step is to take a IBM GPFS snapshot. Login to any server of the SAP HANA installation. It
does not matter on which server you issue the IBM GPFS snapshot commands.
mmcrsnapshot sapmntdata <snapshotname>
Writing dirty data to disk
Quiescing all file system operations
Writing dirty data to disk again
Resuming operations.
Snapshot <snapshotname> created with id 2.

We recommend to include the current data and/or time in the snapshot name. You can do this via
mmcrsnapshot sapmntdata `date +%F--%T`

After this command has finished you have a new folder <snapshotname> in /sapmnt/.snapshots This
sub-folder contains all files that you can then use to copy to a safe place. The IBM GPFS snapshot is
taken from the entire IBM GPFS file system.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 21
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

If the IBM GPFS snapshot has finished successfully confirm this fact and release the SAP HANA snap-
shot. In SAP HANA Studio click on Confirm. This opens the following dialog:

We recommend to use the name given to the IBM GPFS snapshot as part of the mmcrsnapshot command.
After you acknowledge this window the wizard finishes and you can leave the storage snapshot dialog.
If the IBM GPFS snapshot did not finish successfully or was manually aborted, click on the “Abandon”
button and act accordingly.
Copy the IBM GPFS snapshot data to a safe place on an external storage device. E.g. this could be an
NFS export on a storage server. Although this can be done with any of the following tools: simple Linux
copy (cp), secure copy (scp) or rsync command, we recommend to use only the rsync command due to
potential issues when SAP HANA uses over 90% of the total memory. A simple Linux copy, or even a
secure copy could lead to out of memory (OOM) conditions on the server copying the data to the backup
storage.
Other tools are possible. This is dependent on the level of integration into products like IBM Tivoli
Storage Manager, SEP Sesam or other automated file backup tools. This depends highly on the customer
demands and availabilities regarding hardware and backup requirements. Please consult the backup
vendors documentation with regards to their integration available.
See table 3 for the files and directories which need to be copied to an external storage in order to have a
full SAP HANA backup.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 22
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

Path Exclude
/sapmnt/.snapshot/<snapshotname>/shared/
/sapmnt/.snapshot/<snapshotname>/shared
<SID>/HDB<INST_NR>/backup
/sapmnt/.snapshot/<snapshotname>/data/
<SID>

Table 3: Required SAP HANA directories for restore

After data is successfully copied you need to delete the IBM GPFS snapshot:
mmdelsnapshot sapmntdata <snapshotname>

Having more than one active snapshots at a time is supported by IBM GPFS. The maximum number
of snapshots in sapmntdata is 256 (this applies to IBM GPFS 3.5 and 4.1). You can list all existing
IBM GPFS snapshots with mmlssnapshot sapmntdata
However, keep in mind that all IBM GPFS snapshots still remain on the same physical disks as your
production SAP HANA data. This does by no means represent a valid backup location! Moreover,
having IBM GPFS snapshots will lead to a slightly decreased file system performance. Therefore it is
essential to move and archive such backup to a remote device and to delete the snapshot as soon as
possible.

3.5 Restore of XFS

For single node setups, the simplest way to restore the SAP HANA data, log and shared file systems
is to follow the section "SAP HANA Database Backup and Recovery" which can be found in the SAP
HANA Administration Guide on the SAP HANA Help Portal. A generic overview of how to backup
and restore the SAP HANA database can be found in SAP SCN — SAP HANA Backup/Recovery
Overview.

3.6 Restore of IBM GPFS

To prepare for a restore:


• SAP HANA instance must be stopped.
• Copy from the backup data data/<SID> to /sapmnt/data/<SID> (see screenshot of the terminal
window below).
• In case that you want to restore SAP HANA data on an new instance you need to restore the
profiles.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 23
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

• Ensure correct file permissions on the snapshot data. File owner must be the database administra-
tor.
The terminal screenshot below visualizes a snapshot (plus sub-folders and files) that has been copied back
at the correct location. Simple tools like cp, scp or rsync can be used to copy back the data.
This data can then be used for restoration.

There are two ways to restore the SAP HANA snapshot. Either with SAP HANA Studio or with a
command line statement.

Restore with SAP HANA Studio

Warning
The snapshot restore functionality in SAP HANA Studio revisions 80 and 81 are broken.
These two revisions of the SAP HANA Studio should not be used to restore a backup taken.
If it is not possible to upgrade the SAP HANA Studio to revision 82 or higher, then you will
need to recovery using the command line as described in 3.6: Restore via command line on
page 26.
In SAP HANA Studio right-click on the SAP HANA instance you want to recover to and select “Recover”.
The recovery wizard appears.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 24
1.12.121-16 © Copyright Lenovo, 2016
Technical Documentation

Specify “Snapshot” as the type of backup to recover from. This disables the location box.

If you restore on the same system from which the snapshot was taken you can skip the license key question.
If you are restoring to a different system you need to provide a license key. If you do not specify a valid
key the restore still completes successfully but the database instance will be locked afterwards. It is
possible to specify a valid license key later on.

The final screen summarizes the restore parameters.

Backup and Restore Guide Lenovo® Systems Solution™ for SAP HANA® 25
1.12.121-16 © Copyright Lenovo, 2016

You might also like