5 1 0:Creating a System Copy of an SAP HANA Database

From SEPsesam


Welcome to the latest SEP sesam documentation version 5.1.0 Apollon. For previous documentation version(s), check documentation archive.


Overview


You can use SEP sesam and SAP HANA Studio to create a system copy of an SAP HANA 2 tenant database. Typically, a system copy is performed to restore a database backup from the production system to a test instance for testing and development purposes. This process involves preparing the source and target environments, creating the necessary tenant database on the target system, and configuring SEP sesam backups. After copying the required SEP sesam configuration files, the database recovery is performed using SAP HANA Studio. After the recovery, it is recommended to verify the system copy to ensure the copied database is ready for use in your target environment.

Prerequisites

  • A working SAP HANA backup of both the source and the target database, with backint to SEP sesam.
  • The source and target systems must have different SIDs (SAP restriction).
  • The target system must have the SAP HANA database installed and the target SID must exist.

Preparing the environment

To prepare for the system copy of the SAP HANA database, select the target tenant database on the target server. You can use an existing database, or create a new one. Connect to the SYSTEMDB of the target SID using hdbsql and execute the following command:

CREATE DATABASE <database_name> SYSTEM USER PASSWORD <password>;

When the new tenant database is created, verify the connection to ensure everything is set up correctly. Then perform the following steps to prepare the source and target systems:

  1. Ensure that the source and target systems are set up and that the SAP HANA Backint parameter files are configured for backing up the catalog, data, and log files.
    The SAP HANA Backint parameter file (*.utl) contains all relevant information for backing up SAP HANA with SEP sesam. It contains special keywords which are used by the SEP sesam hdbbackint module. The files are generated in /var/opt/sesam/var/ini/. Two sets of Backint parameter files are required, one set to access the backups from the source database, and the other to restore the backups to the target database.
  2. When the source and target systems are set up, configure SEP sesam backups for the target tenant database. Ensure that backups are working correctly for the target tenant database. Optionally, you can check the last catalog backup of the source tenant database in SAP HANA Studio to make sure it is available for the recovery process.
  3. Copy the necessary SEP sesam configuration (.utl) files from the source system to the target system using the following command:
    scp root@sapval:/var/opt/sesam/var/ini/backint_<SID>_<database_name>* /var/opt/sesam/var/ini/
  4. On the target system, edit the copied .utl files and change the SSB_LOGFILE parameter to the correct path:
    SSB_LOGFILE=/usr/sap/<SID>/HDB<instance>/<SAP_hostname>/trace/hdbbackint_$u_VAL_log_%Y-%m-%d.log
Note
If the target system is a multi-host system, make sure to copy the .utl files to all hosts.
Example

Example source system:

   SAP hostname:   sapval
   SID:            VAL
   Database name:  VAL
   SEP sesam SAP HANA *.utl files:
       /var/opt/sesam/var/ini/backint_VAL_VAL_catalog.utl
       /var/opt/sesam/var/ini/backint_VAL_VAL_data.utl
       /var/opt/sesam/var/ini/backint_VAL_VAL_log.utl

Example target system:

   SAP hostname:   sapcert01
   SID:            SEP
   Database name:  VAL
   SEP sesam SAP HANA *.utl files:
       /var/opt/sesam/var/ini/backint_SEP_VAL_catalog.utl
       /var/opt/sesam/var/ini/backint_SEP_VAL_data.utl
       /var/opt/sesam/var/ini/backint_SEP_VAL_log.utl

The path for the SSB_LOGFILE parameter on the source system is:

SSB_LOGFILE=/usr/sap/VAL/HDB00/sapval/trace/hdbbackint_$u_VAL_log_%Y-%m-%d.log

And on the target system this is changed to:

SSB_LOGFILE=/usr/sap/SEP/HDB01/sapcert01/trace/hdbbackint_$u_VAL_log_%Y-%m-%d.log

Start the System Copy in SAP HANA Studio

To create a system copy of an SAP HANA database on a different target system, use SAP HANA Studio.

Note
The following procedure describes the steps that are performed in SAP HANA Studio. As this process is not native to SEP sesam, SEP cannot guarantee the accuracy of this procedure. Users are strongly advised to consult the SAP documentation for the most up-to-date information and verify the steps in SAP documentation.
  1. Open SAP HANA Studio and log in to the target SID SYSTEMDB.
  2. Right-click the connection to the target database, and then click Backup and Recovery -> Recover Tenant Database.
  3. Select the target tenant database to which the source database will be copied.
  4. In the Specify Recovery Type window, select either Recover the database to its most recent state or Recover the database to a specific data backup.
  5. In the Locate Backup Catalog window, select Recover using the backup catalog and then Search for the backup catalog in Backint only. Then select Backint System Copy and specify the SID of the source system and the tenant database name in the format <DB_NAME>@<SID>.
  6. Stop the target tenant database.
  7. The recovery process searches for the most recent catalog and displays the latest data backups. Ensure that the correct backups are shown, and the most recent catalog found must be from the source database. Select the backup you want to recover. Optionally, you can click Check Availability to check if the selected backup is available at the location.
  8. Keep the default settings for log backup files.
  9. Select Initialize log area.
  10. Review the recovery options. Optionally, you can show and copy the SQL statement used for recovery process. Click Finish to start the recovery.

When the recovery process finishes and the source database is successfully copied to the target database, the target database is started.


See also

SAP HANA BackupSAP HANA Logbackup and SavepointsSAP HANA Restore

Copyright © SEP AG 1999-2024. All rights reserved.
Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.