image_pdfimage_print

With SAP HANA 2.0 one of the biggest changes is its multitenancy property. By default, SAP HANA 2.0 will have multitenant database containers (MDC) and it is the only operational mode. In this three-part blog series, I am going to cover in detail how to use FlashArray//m snapshots for doing backup and recovery of SAP HANA 2.0 MDC system with only Single Tenant. This is the current limitation from SAP where only SAP HANA 2.0 MDC system with the single tenant is supported with storage snapshots. The first part you would have seen (here is the link:https://krishnasatyavarapu.wordpress.com/2018/01/17/backup-and-recovery-of-sap-hana-2-0-multitenant-database-containers-with-single-tenant-on-pure-storage-flasharray-m-using-snapshots-part-1/)is about how to perform backups using storage snapshots using SAP HANA studio.

In this part, I will cover the recovery of SAP HANA MDC system. In the third part, I will cover how to automate this whole process using shell scripts.

SAP HANA 2.0 MDC basically consists of a system database and one or more tenant databases. System database is used for overall system administration activities and tenant databases are self-contained and completely isolated in terms of persistence layer, database catalog, repository, backups, and logs. As mentioned previously storage snapshots will work only for SAP HANA MDC systems with a system database and only one tenant database.

As shown below, is a SAP HANA MDC 2.0 system with one system database and one tenant database.

HANAMDC

Recovery procedure using storage snapshots for SAP HANA MDC system:

Here is the backup using snapshots which I have taken last time: Go to the backup Catalog and look for the backup id from which you would like to do the recovery of SAP HANA MDC system.

recovery_MDC_1

We will start the recovery process with the System Database.Start the recovery process in SAP HANA studio:

  1. Go to the system database of this SAP HANA system and in the context menu select Backup and recovery–> Recover System Database which is SYSTEMDB@PSD. This will shut down the system

recovery_MDC_2

2. In the recovery window as shown below select Recover the database to a specific data backup.

recovery_MDC_3.png

3. Then, select Recover without the backup catalog

recovery_MDC_4

4.  Unmount the Data volume using the mount point as

umount /hana/data/PSD

5. Login to Pure Storage GUI and update the data volume using the snapshot from which we would like to recover.

6. Mount the data volume using the mount command.

mount /dev/mapper/3624a93701037b35fd0ef40a5000124ec /hana/data/PSD

6. Select snapshot as destination type.

recovery_MDC_6

7. By default, the Log area will be initialized as shown below

recovery_MDC_7.png

which is equivalent to the below SQL statement and start the recovery of the System database.

RECOVER DATA USING SNAPSHOT CLEAR LOG

Once the recovery of the system database is done you will see the following message tells you that you also need to recover tenant database as well.

recovery_MDC_8

 

9. Now let us start the recovery of the Tenant database from the System database select the Backup and Recovery –> Recover Tenant Database

recovery_MDC_9.png

10. Select the tenant which needs to be recovered which is PSD in this case

recovery_MDC_10

11. Select the recovery type for this tenant which is “Recover the database to a specific data backup”.

recovery_MDC_11.png

12. Specify the backup location as “Recover without the backup catalog”

recovery_MDC_12.png

13. Provide the destination type “Snapshot” as shown below

recovery_MDC_13.png

14. Initialize the log area as we did for the system database.

recovery_MDC_14.png

this all is equivalent to the following SQL statement

RECOVER DATA FOR PSD USING SNAPSHOT CLEAR LOG

This will start the recovery of the tenant database.

15. You will see the following message saying PSD@PSD(PSD tenant) is recovered.

recovery_MDC_15.png

 

In the next part, I will explain how to write a script to automate the full backup process using snapshots.