SAP HANA Multitenant Database Container Database Restore to a Different Tenant Database

If you have SAP HANA 2.0 SPS01 or higher, then you restore a tenant database to a different tenant database name (database copy).

You can perform the restore by using any of the following methods:

  • Perform the restore from the CommCell Console. For more information, see Restoring a SAP HANA Tenant Database.

  • Perform the restore from the latest version of SAP HANA Studio (Version 2.37 or later). Perform a database copy restore to the same tenant database name or a different tenant database name across the same SID or an different SID for the SYSTEMDB.

  • Perform the restore by using the SAP HANA command line interface. Perform a database copy restore to the same tenant database name or a different tenant database name across the same SID or an different SID for the SYSTEMDB.

Before You Begin

If you use SAP HANA Studio, or the SAP HANA command line interface, then you must updated the destination param file.

For more information, see SAP HANA BACKINT Configuration Parameters.

Note

The destination SID must be online.

You only need to specify the srcCrossClient parameter when the source SID name is different from the destination client name.

CvInstanceName 
<Dest_Instance_Name> 
CvClientName 
<Destination_Client_Name>
srcCrossClient 
<Source_Client_Name>
srcCrossSIDName 
<Source Database_Name>

Example

In the following example, the source client is myhana01, and the destination SID is T02. The source SID is S02.

CvInstanceName 
Instance001 
CvClientName 
myhana02 
srcCrossClient 
myhana01 
srcCrossSIDName 
S02

SAP HANA Studio

In the following example, the source SID is S02 and the destination SID is T02.

  1. Open SAP HANA Studio (Version 2.37 or later).

  2. Start a Database Copy Restore.

  3. On the Page 1 , specify the tenant database. You can select the same tenant database name as the source tenant database name, or a different one.

  4. On the Specific Recovery Type page, choose the Recovery Type, for example, Recover the database to its most recent state.

  5. On the Locate Log Backups page, locate the backup catalog, and then use the Search for the backup catalog in Backint only option.

    Note

    Make sure that the catalog backups that are on the source SID for all the databases were performed by using the backint option.

  6. On the Locate Log Backups page, in the select the check box, and then in the Source System box, type the tenant SID. In this example, use TN1@S02.

  7. On the Select a Backup page, select the backup job, and the proceed with the restore.

    Note

    Make sure that you select t he Initialize Log Area check box.

  8. Repeat the steps for the SYSTEMDB. Make sure to select the SYSTEMDB SID. In this example, use SYSTEMDB@S02.

SAP HANA Command Line Example

In the following example, the source SID is S02 and the destination SID is T02.

  1. On the command line, type the following command to perform a SYSTEMDB restore:

    su - t02adm Last login: Thu Sep 21 14:24:32 IST 2017 on pts/0 t02adm@myhana02:/usr/sap/T02/HDB02> /usr/sap/T02/HDB02/HDBSettings.sh recoverSys.py --command="RECOVER DATABASE UNTIL TIMESTAMP '2017-09-21 09:01:06' CLEAR LOG USING SOURCE 'SYSTEMDB@S02' CHECK ACCESS USING BACKINT " --wait --timeout=60 [140171592451904, 0.003] >> starting recoverSys (at Thu Sep 21 14:34:08 2017) [140171592451904, 0.003] args: () [140171592451904, 0.003] keys: {'command': "RECOVER DATABASE UNTIL TIMESTAMP '2017-09-21 09:01:06' CLEAR LOG USING SOURCE 'SYSTEMDB@S02' CHECK ACCESS USING BACKINT ", 'timeout': '600', 'wait': True} recoverSys started: 2017-09-21 14:34:08 testing master: myhana02 myhana02 is master shutdown database, timeout is 600 stop system stop system: myhana02 stopping system: 2017-09-21 14:34:08 stopped system: 2017-09-21 14:34:24 creating file recoverInstance.sql restart database restart master nameserver: 2017-09-21 14:34:29 start system: myhana02 2017-09-21T14:35:02+05:30 P124296 15ea3ae801b INFO RECOVERY state of service: nameserver, myhana02:30201, volume: 1, RecoveryPrepared 2017-09-21T14:35:30+05:30 P124296 15ea3ae801b INFO RECOVERY RECOVER DATA finished successfully, reached timestamp 0001-01-01T00:00:00+05:30, reached log position 18446744073709551615

  2. On the command line, type the following command to restore the tenant database:

    In this example, the destination tenant database is TN2 and the source tenant database is TN1.

    t02adm@myhana02:/usr/sap/T02/HDB02> /usr/sap/T02/HDB02/exe/hdbsql -U BACKUPM "RECOVER DATABASE FOR TN2 UNTIL TIMESTAMP '2017-09-21 09:13:50' CLEAR LOG USING SOURCE 'TN1@S02' CHECK ACCESS USING BACKINT

Loading...