# Restoring to a Different Location (Out of Place)

You can restore a SAP HANA database to a different location (out of place).Before the restore operation begins, the SAP HANA software stops the database. After the restore operation completes, the SAP HANA software restarts the database.

To recover only the data, perform the restore by using a full backup.

## Before You Begin

- The restore environment must have the same set of nodes as the backup environment. If you modified the backup environment, then you must make the same modifications on the restore environment.

- The version of the SAP HANA software on the destination must be the same version or a more recent version than on the source.

- If you want to restore the most recent backup data and log files, stop SAP HANA replication. If you do not stop SAP HANA replication, only the most recent data—and not the most recent log— is restored.

- If you are using a SAP Secure User Store key for authentication in source HANA instance, verify that both the source HANA machine and the destination HANA machine has the hdbuserstore key created with the same user and password of the user that has necessary permissions.

- To restore a database on SAP HANA 2.0 SPS07 with encryption enabled for the HANA SID, refer to the following procedure:

  Steps to copy the encryption keys from the source to the target SID

  Commvault supports HANA 2.0 SPS07 if encryption is not enabled for the HANA SID.

  If encryption is enabled for the HANA SID and you want to perform an in-place restore, verify that the encryption key is same between backup and restore.

  If encryption is enabled for the HANA SID and you want to perform an out-of-place restore (database copy), copy the encryption keys from the source to the target SID before restoring the data. It is not needed to copy the encryption keys for subsequent restores unless the key on the source has changed.

  To back up and recover encryption keys on SYSTEMDB:

  1. Use hdbsql to log on as the SYSTEMDB user:

         hdbsql -i $[Instance number] -d $[SYSTEMDB] -u system -p $[password]

  2. Back up root key for SYSTEMDB using any one of the following command:

     - Use hdbsql to run the following command:

           hdbsql SYSTEMDB=> ALTER SYSTEM ENCRYPTION CONFIGURATION CONTROLLED BY SYSTEM DATABASE
           0 rows affected (overall time 2403.486 msec; server time 2403.314 msec)
           hdbsql SYSTEMDB=> ALTER SYSTEM SET ENCRYPTION ROOT KEYS BACKUP PASSWORD Test1234
           0 rows affected (overall time 3642.948 msec; server time 3642.758 msec)
           hdbsql SYSTEMDB=> BACKUP ENCRYPTION ROOT KEYS USING FILE ('backup001')
           0 rows affected (overall time 9620.653 msec; server time 9620.465 msec)

     - Use hdbnsutil to run the following command:

           encadm@sdehana01:/usr/sap/ENC/HDB07/backup/sec/SYSTEMDB> hdbnsutil -backupRootKeys dbid1_rootkeys --database_name=SYSTEMDB

  3. Export root key backup for SYSTEMDB (DBID: 1):

         encadm@sdehana01:/usr/sap/ENC/HDB07/backup/sec/SYSTEMDB> ll
         total 8
         -rw-r----- 1 encadm sapsys 1440 Jun 7 17:40 backup001_rootkeys
         -rw-r----- 1 encadm sapsys 1440 Jun 7 17:46 dbid1_rootkeys

     By default, the file is saved to the folder: /usr/sap/ENC/HDB07/backup/sec/SYSTEMDB.

  4. Copy the root key from source to target:

         encadm@sdehana01:/usr/sap/ENC/HDB07> scp -r /usr/sap/ENC/HDB07/backup/sec/SYSTEMDB/backup001_rootkeys
         pncadm@sdehana02:/usr/sap/PNC/HDB03/backup/sec/SYSTEMDB/
         pncadm@sdehana02's password:
         backup001_rootkeys     100% 1440   9MB/s   0:00

  5. After the root key is copied from source to target system, run the root key recover command:

         h07adm@sde-newhana1:/usr/sap/$[target-SID]/HDB09/backup/sec/SYSTEMDB> hdbnsutil -recoverRootKeys /usr/sap/$[target-SID]/HDB09/backup/sec/SYSTEMDB/backup001_rootkeys --database_name=SYSTEMDB
         Please Enter the password:
         Importing root keys for DBID: 1 from /hana/shared/$[target-SID]/HDB09/backup/sec/SYSTEMDB/backup001_rootkeys
         Successfully imported root keys from /hana/shared/$[target-SID]/HDB09/backup/sec/SYSTEMDB/backup001_rootkeys
         done.

     You are ready to submit an out-of-place restore from the CommCell Console or the Command Center.

  To back up and recover root keys on a tenant database:

  1. Log on to the tenant database using hdbsql:

         hdbsql $[tenant DB]=> ALTER SYSTEM ENCRYPTION CONFIGURATION CONTROLLED BY SYSTEM DATABASE
         0 rows affected (overall time 2409.361 msec; server time 2409.055 msec)

  2. Log on to hdbsql as SYSTEMDB to set the root key password on the tenant DB.

         hdbsql SYSTEMDB=> ALTER DATABASE $[tenant DB] SET ENCRYPTION ROOT KEYS BACKUP PASSWORD Test1234
         0 rows affected (overall time 2419.350 msec; server time 2419.127 msec)

  3. Back up the root key for tenant DB using any one of the command:

     - Use hdbsql to run the following command:

           hdbsql SYSTEMDB=> BACKUP ENCRYPTION ROOT KEYS FOR NET USING FILE ('backup003')
           0 rows affected (overall time 21.353 msec; server time 21.044 msec)
           netadm@sdehana02:/usr/sap/NET/HDB01> ll /usr/sap/NET/HDB01/backup/sec/DB_NET/
           total 4
           -rw-r----- 1 netadm sapsys 1600 Jun 21 23:14 backup003_rootkeys

     - Use hdbnsutil to run the following command:

           netadm@sdehana02:/usr/sap/NET/HDB01> hdbnsutil -backupRootKeys dbid3_rootkeys --database_name=NET
           Exporting root key backup for database NET (DBID: 3) to /hana/shared/NET/HDB01/dbid3_rootkeys
           done

  4. Copy the root key to the target system as you did for SYSTEMDB.

  5. After you copy the root key from source to target system, run the root key recover command:

     Example:

         $[target-SID]adm@sde-newhana1:/usr/sap/$[target-SID]/HDB09/backup/sec/SYSTEMDB> ll
         total 8
         -rw-r----- 1 $[target-SID]adm sapsys 1440 Jul  6 16:33 backup001_rootkeys
         -rw-r----- 1 $[target-SID]adm sapsys 1440 Jul  7 11:00 dbid3_rootkeys
         h07adm@sde-newhana1:/usr/sap/$[target-SID]/HDB09/backup/sec/SYSTEMDB> hdbnsutil -recoverRootKeys dbid3_rootkeys --database_name=$[target-SID]
         Please Enter the password:
         Importing root keys for DBID: 3 from /hana/shared/$[target-SID]/HDB09/backup/sec/SYSTEMDB/dbid3_rootkeys
         Successfully imported root keys from /hana/shared/$[target-SID]/HDB09/backup/sec/SYSTEMDB/dbid3_rootkeys
         done.

## Procedure

1. From the Command Center navigation pane, go to Protect > Databases.

   The database overview page appears.

2. Go to Instances tab.

   The instance table appears.

3. In the row for the instance that you want to restore, click the action button , and then select Restore.

   Alternatively, click the instance, then select a database from database list in the Recovery points tiles, and click Restore.

   The Restore options dialog box appears.

4. On the Out of place tab, from the Destination server list, select the host to restore the data to.

5. From the Destination instance list, select the instance to restore the data to.

6. In the Number of streams box, enter the number of streams that are applicable for snapshot or backup copy restores.

7. From the Source database, select the source database from where you want to restore.

8. From the Destination database list, select the database to restore the data to.

9. To restore from a snapshot backup, in the HANA data directory box, specify the HANA directory.

   Enter the full path where the destination instance resides. For example, if the SAP HANA SID path is hana/data/SID, then enter /hana/data.

   Note

   This value is required for IntelliSnap cross-instance and cross-machine restores.

10. For Recover to, specify how to restore the instance:

    - Select the restore by specifying the most recent state, select Most recent state.

    - To recover the database to a point-in-time, select Point in time, and then select the date and time.

    - To restore by specifying the backup prefix, select Using backup prefix, and then enter a prefix to identify the backup.

      The Commvault software creates the backup prefix by pre-pending the job ID to the backup prefix. For example, if you enter COMPLETE_DATA_BACKUP, then the backup is named 4815976_COMPLETE_DATA_BACKUP. You do not need the catalog backup available with backint.

    - To restore by specifying the internal backup job ID, select Using internal backup id, and then enter the internal backup job ID.

      Note

      If you restore by specifying the internal backup job ID, then you must have the catalog backup available with backint. SAP HANA creates the internal backup ID.

11. Under Advanced options, do the following:

    - To restore from a storage policy copy if backup gets corrupted, from the Restore from copy list, select the copy that you want to use.

    - Select a media agent from the Select MediaAgent box.

    - To restore SAP HANA catalog to a point in time, move the Restore catalog from time toggle key to the right, and then do the following:

      1. To restore to a point in time, select Point in time, and then enter the date and time.

      2. To restore relative to the system date, select Relative to sysdate, and then enter the number of days or hours relative to the system date.

    - To verify that all the backups that are required for the recovery operation are available, select the Check access check box.

    - To initialize the log area after the restore, select the Initialize log area check box.

    - To recover using delta backups, select the Use delta backups check box.

      If you do not use a delta backup for the recovery option, the software uses only the log backups for recovery.

12. Under Pre or Post options, do the following:

    - In the Pre recovery command box, enter the name or path of the process to run before the restore. Alternately, select the file icon on the right side to select a physical client from the Physical client selection list.

    - In the Post recovery command box, enter the name or path of the process to run before the restore. Alternately, select the file icon on the right side to select a physical client from the Physical client selection list.

    - If you want to initiate the restore as user, move the Run as User toggle button to right.

      - In the User name box, enter a user name you want to run the restore with.

13. Select the Notify user on job completion checkbox to send a notification email when the restore job is completed.

14. You can configure a schedule to repeat this restore operation. To create a schedule, do the following:

    1. Click Schedule.

       The Add schedule dialog box appears.

    2. In the Name box, type a name for the schedule.

    3. Configure the Frequency and Repeat parameters.

    4. To specify exceptions to the schedule, click Exceptions.

       The Exceptions dialog box appears.

    5. Configure the exception parameters:

       - You can click Add Exception to save a set of exception parameters and continue adding sets of exception parameters.

       - Click Save when you have finished configuring the exception parameters.

    6. Under the Range of recurrence section, specify the Start date and End date to schedule the recurrence range of the restore operation.

    7. To save the schedule and return to the restore dialog box, click Schedule.

15. Click Submit.

## Related Topic

Viewing and Editing Database Restore Schedule.

×

Loading...