Identifying Database Copy Scenarios

Objectives

After completing this lesson, you will be able to:

  • Identify database copy scenarios

Copying a Database Using Backup and Recovery

You can create a homogeneous copy of an SAP HANA database by using backups of that database to recover to the same system or a different system. A homogeneous database copy is a quick way to set up a cloned database, for example, for training, testing, or development.

You can use backup and recovery to copy a system database or a tenant database within the same system or to a different system. You can create a copy of a database using a complete data backup or a data snapshot. Also, using delta backups (differential or incremental backups) and log backups allows you to copy the database to a specific point in time.

Prerequisites for Copying a Database Using Backup and Recovery

Before you can create a copy of an SAP HANA database, some important preparations are needed:

  • You can copy a database to machines from different vendors and with different hardware configurations.

  • To copy a complete SAP HANA system, the system database needs to be recovered first, and then all the tenant databases are recovered individually.

  • For the system database, you must have the logon credentials of the <sid>adm user.

    For a tenant database, the system database user must have the authorization DATABASE ADMIN.

  • If you expect a different set of volumes to be recovered, before you start the recovery for a database copy, you should remove existing data and log volumes.

Note

When copying a database to machines from different vendors and with different hardware configurations, it is provided that both the source and target machines are compliant with the SAP HANA appliance specifications.

Special requirements may apply to ensure the compatibility of SAP HANA backups with IBM Power Systems.

Prerequisites for the Source Database

  • You can copy an SAP HANA database using file-based backups or backups created using third-party tools.

  • Make the data backups, the delta backups, and the log backup files from the source database available in the appropriate directory in the target database.

  • The content of the log area of the source database cannot be used for recovery.

Prerequisites for the Target Database

  • The version of the SAP HANA target database is the same or higher than the SAP HANA source database.

    For a database copy using SAP HANA cockpit, the target database must be at least SAP HANA 2.0 SPS 01.

  • The target database has sufficient disk space and memory.

  • The target system can have any number of hosts.

  • A valid license key is available for the target database.

Note

The number and type of services in tenant databases is set automatically during a copy from a complete data backup when a backup catalog is used.

If desired, and if performance limitations are acceptable, a copy of a database can be set up on a platform with less memory and CPU capacity and a different number of hosts.

After a recovery to create a database copy with a different set of volumes, the system may include different volumes, or volumes may be assigned to different hosts.

Existing volumes that are not used for the new system will not be overwritten or removed. Any additional disk space is not released. This may lead to unexpected disk full situations.

Copy a Database Using a Database Backup

You can copy an SAP HANA database using file-based backups or backups created using third-party tools.

Note

The backup catalog, the data backups, and the log backups must be from either only a third-party backup tool or only the file system.

(For a standard database recovery, it is possible to use a combination of backups from a third-party tool and the file system, provided that the backups originate from the same SAP HANA database.)

Using the SAP HANA cockpit, you can create a copy of an SAP HANA database by using backups of that database to recover to the same system or a different system.

If you are copying a database using a full data backup only, you can either select the data backup from the backup catalog, or specify its location without using a backup catalog.

A copy to a point in time is not possible if the full data backup is not recorded in the backup catalog.

Copy a Database Using a Data Snapshot

Prerequisites

  • For a database copy using data snapshots, the number of hosts and the number and type of services assigned to each host must be the same for the source database and the target database, and the mountpoint IDs must be identical.
  • Using a data snapshot, it is only possible to copy an SAP HANA system with one tenant database.
  • When you recover SAP HANA from a data snapshot, you need to recover both the system database and the tenant database.
  • To copy SAP HANA from a data snapshot, you first need to stop the target SAP HANA database, then make available the data snapshot in the data area of the target database.
Note

If you attempt to use a data snapshot to copy an SAP HANA system with more than one tenant database, this may make the data area for all the tenant databases unusable.

Database Copy from System with m Nodes to a System with n Nodes

You can copy an SAP HANA database system with m nodes to an SAP HANA database with n nodes. This is useful for when you want to use a copy of your production system for tests on a smaller QA system, for example.

In the following examples, the source database and the target database are both tenant databases.

Target Database Has Fewer Hosts Than the Source Database

Example: The source database has two hosts, each with one index server. The target database has only one host.

All content of the data backup is recovered to the target host.

The target database now holds the data of the two hosts from the source database, and there are two index servers on the single-host target database.

Target Database Has More Hosts Than the Source Database

Example: The source database has two hosts, each with one index server. The target database has three hosts.

  • All content of the backup is recovered to the two existing hosts.

    At this stage, the third host in the target system remains unused.

  • After the recovery, you can distribute all the data in the target database from the two hosts to the three hosts that are now available.

  • A database with three hosts has been created, containing the data from the previous two-host database.

Copying or Cloning of an SAP HANA System

You can use the SAP HANA database lifecycle manager (HDBLCM) to make a copy or a clone of an SAP HANA system by copying the file system containing the SAP HANA database installation from an old storage solution to a new storage solution, and registering the copied SAP HANA system on new hosts.

Before cloning the SAP HANA system, you must create a physical copy of the SAP HANA system (storage snapshot, file systems copy). The source system must be offline or a database snapshot must have been taken on the source system before the physical copy of the SAP HANA system is created.

Note

An SAP HANA system can only be cloned or copied to a target system that runs on the same hardware platform as the source system.

Cloning an SAP HANA system produces a new SAP HANA system, identical to the existing one. Copying an SAP HANA system produces a new SAP HANA system with the same landscape as the existing one, but with slightly different parameter settings. If the interactive parameter defaults are accepted during host registration, the system is effectively cloned. If the new system parameters are set to different values, the new system is similar, but not identical to the source system.

You could, for example, copy an existing production system, and accept all parameter defaults during host registration except system_usage, which would be specified as "test". This configuration would allow you to have an almost identical copy of the existing system for test or quality assurance purposes.

To clone an SAP HANA system to new hardware, follow these steps:

  1. Copy the file system to the new storage
  2. Mount /hana/shared to the new hosts
  3. Register the copied SAP HANA instances on the new hosts using -action=register_rename_system

Copying and Movement of Tenant Databases Between Systems

Copying and moving tenant databases between systems allows you to manage your system landscape efficiently and to respond flexibly to changing resource requirements. Therefore, SAP HANA uses system replication mechanisms. These mechanisms allow you to copy and move tenant databases securely and conveniently with near-zero downtime.

First, the tenant database is copied with all of its data to a newly created tenant database in a target system.

The only difference between copying and moving a tenant database therefore is what happens to the original tenant database after all data has been transferred to the new tenant database in the target system.

In both cases, the new tenant database starts running as a fully separate, independent database.

Several tenant databases can be copied or moved to a system at the same time. It is also possible to copy or move a tenant database to a system with a different isolation level than the source system.

Use Cases for Copying and Movement of Tenant Databases

Copying and moving a tenant database from one system to another in this way has the following use cases:

  • Load balancing between systems

    For example, a tenant database is running a more demanding workload than anticipated, so you move it to a system running on a host with more CPU resources.

  • Management of deployment environment

    For example, you want to copy a tenant database running in your test system to the live production system.

  • Tenant-database-specific upgrades

    For example, you want to upgrade a single tenant database but not the entire system, so you move the tenant database to a system already running the higher version.

  • Template databases

    For example, you create a tenant database with a default configuration that you want to reuse as the basis for new tenant databases in other systems. You can simply copy the tenant database as a template to other systems.

Log in to track your progress & complete quizzes