Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

This section provides information about which options exist to create a copy of a SAP MaxDB database.


  1. What options exist currently to create a SAP MaxDB database copy?
  2. Creating a copy via backup/recovery
  3. Creating a copy via a database snapshot
  4. Creating a copy via LOADERCLI

What options exist currently to create a SAP MaxDB database copy?

The first and recommended option is Backup/Recovery. As a second option database snapshots can be used to freeze a specific state of a database and to reactivate it again later. The third option is to use the tool LOADERCLI for exporting database content and importing it into a new created database which was installed via SDBINST or SDBSETUP. Please be aware that a heterogeneous system copy is created with the third option. More information about the different database system copies you can find in SAP note 1014782 FAQ: SAP MaxDB System Copy.

back to top

Creating a copy via backup/recovery

This is the first and well known option. It means that a backup from one SAP MaxDB database (source database) is imported into another SAP MaxDB database (target database). As a precondition the target database software has to be either of the same version as the software of the source database or of a higher version. As of version 7.6 it is possible to import a backup into a database as of version 7.6 with a higher support package level. More information you find in SAP note 129352 Homogeneous System Copy with SAP MaxDB.

For example: A backup of a database of version 7.6.02 build 10 can be imported into a target database of version 7.6.04 build 12.

It is necessary to take care of the byte order of the source and the target server (homogeneous or heterogeneous copy). More information can be found via the relevant links and/or SAP notes or within the SAP MaxDB documentation: Database Copy.

back to top

Creating a copy via a database snapshot

Via this option you can save a specific dataset within the same database. So you don't create a real independend copy which can be imported into another database on a different server. A further constraint is that it is not possible to use the dataset stored within a snapshot in parallel to the current dataset which was changed compared to the snapshot. But if having it on a different server and using both datasets in parallel are not basic requirements it is a quite convenient method of e.g. doing the following:

  1. freeze the current dataset of a database by creating a database snapshot
  2. make changes, developments or whatever which causes significant manipulation on this dataset
  3. the decision comes up to go another way and to discard these changes
  4. restoring the database snapshot and again have the dataset as before the manipulation

For database version 7.6 database snapshots are created in operational state ADMIN and only one snapshot can exist at the same time. As of SAP MaxDB version 7.7.04 snapshots can also be created in operational state ONLINE and multiple snapshots can exist in parallel.

Creating a database snapshot in operational state ADMIN

Up to version 7.7.03:

  • Using Database Studio: Choose Administration in the context menu of the database and afterwards tab page Snapshots. On the right hand side a button Create... can be found.
  • Using Database Manager CLI: dbmcli -d <database_name> -u <dbm_operator>,<password> db_execute create snapshot

(warning) Please keep in mind:
Only one snapshot can exist at the same time. If you create a snapshot an existing one will be overwritten.

As of version 7.7.04:

  • Using Database Studio: Same as up to version 7.7.03. In addition you can enter an optional comment to store information about e.g. why the snapshot was created. This can be of help if several snapshots exist to sort out what they are intended for. This comment can have a length of up to 60 characters.
  • Using Database Manager CLI: dbmcli -d <database_name> -u <dbm_operator>,<password> db_execute create snapshot ['<comment>']

(warning) Please keep in mind:
Several snapshots (max. 100) can exist in parallel. You can select them via system table SNAPSHOTS ((select * from snapshots)) or Database Studio (choose Administration in the context menu of the database and afterwards tab page Snapshots). The database has to be in operational state ONLINE to do this. If you create a snapshot the existing one/ones are not overwritten.

Creating a database snapshot in operational state ONLINE

This is only possible as of database version 7.7.04.

  • Using Database Studio: Choose Administration in the context menu of the database and afterwards tab page Snapshots. Here all existing snapshots are listed (content of system table SNAPSHOTS). On the right hand side there is a button Create.... When choosing this button a popup appears where a comment can be entered. After choosing Create at the bottom of the popup the snapshot creation starts and when finished the new snapshot appears at the top of the list of snapshots.
  • Using Database Manager CLI: dbmcli -d <database_name> -u <dbm_operator>,<password> db_execute create snapshot ['<comment>'] [timeout <value>]
    Adding a comment as well as a timeout are optional.

(warning) Please keep in mind:
 In database version 7.6 there is no confirmation if a snapshot is created. But there is an entry for this in file dbm.prt (database manager log file). As of database version 7.7 this entry has been moved to file KnlMsgArchive (database errors).

What about transactional consistency of a snapshot?

In terms of a database copy a snapshot is always transactional consistent even though it is possible that not all open transactions could be committed before the snapshot was created. If a create snapshot is executed in operational state ONLINE first of all a savepoint is created. The snapshot is based on this savepoint which of course can include open transactions. All changes done by open transactions are rolled back to the corresponding BEFORE IMAGES when the snapshot is restored later. That's why the database is transactional consistent again afterwards. Creating a snapshot in operational state ONLINE includes a default timeout of 60 seconds to get open transactions finished. This timeout can be specified explicitly when the snapshot is created, e.g.:
create snapshot 'S1' timeout 120.
In this case the database is waiting for 120 seconds to finish open transactions before creating the snapshot. New transactions are not allowed during this time. A snapshot created in operational state ADMIN is based on the savepoint which was created when the shutdown of the database was executed.
As of database version 7.7.04 system table SNAPSHOTS contains a column named TRANSACTIONCONSISTENT which shows if a snapshot contains open transactions to be rolled back (also visible in Database Studio on tab page Snapshots).

 

Restoring a database snapshot
  • Using Database Studio: Choose Administration in the context menu of the database and afterwards tab page Snapshots. Here all existing snapshots are listed (content of system table SNAPSHOTS) if the database is in operational state ONLINE. On the right hand side there is a button Revert to.... At first the snapshot to be restored has to be selected in the list. After this button Revert to... gets active. When choosing this button a popup appears which tells that the database is in operational state ONLINE and has to be in operational state ADMIN for restoring a snapshot. When button ADMIN   has been chosen as well as button Next  on a second popup information of the chosen snapshot is displayed and the checkbox for restarting the database after restoring the snapshot can be marked. Choosing Revert to  will start the process. There is no confirmation message.
  • Using Database Manager CLI (database has to be in operational state ADMIN):
    dbmcli -d <database_name> -u <dbm_operator>,<password> db_execute restore snapshot ['<snapshotID>']

(warning) Please keep in mind:
When a snapshot is restored the existing database log will be deleted (information on log volumes for redo log). The snapshot which was restored will be kept alive for restoring again later. Existing snapshots which are newer than the restored one will be deleted. If no snapshot ID is specified (when using Database Manager CLI) the oldest snapshot will be restored.

Important:

Database snapshots are not saved within a data backup.
Database snapshots do not replace the necessity of creating regular data backups.


For more information about snapshots refer to the SAP note 1423732 FAQ SAP MaxDB Database Snapshots

back to top

Creating a copy via LOADERCLI

This option is relevant for a heterogeneous database system copy, is regularly used in the SAP Content Server context and is described in detail in the SAP note 962019 System Copy of SAP MaxDB Content Server Database.

back to top

Relevant SAP Notes

1014782 FAQ System Copy
129352 Homogeneous System Copy with SAP MaxDB
962019 System Copy of SAP MaxDB Content Server Database
1423732 FAQ SAP MaxDB Database Snapshots