Full System Recovery: Restoring the SAP MaxDB Database from the SAP Command Line

Updated

Use this procedure when there is a disaster and you want to restore the SAP MaxDB database to a new client by using the SAP MaxDB command line interface.

The examples in this procedure use the following pipe mediums:

  • two for the full data backup (backdata2)

  • two for the incremental data backup (backpages2)

  • one for the log backup (backLog)

Procedure

Warm Database (online)

  1. Perform a full data backup operation.

    1. Place the database in warm mode, and then perform the backup operation. On the command line, type the following commands:

      dbmcli -d DB1 -u dbm,dbm db_warm

      dbmcli -d DB1 -u dbm,dbm -uUTL -c backup_start backdata2

      The software generates an EBID for the job, for example, XBC5DDF5_6006ECE.

    2. Verify that the dbm.ebf file displays the EBID with the backup pipes.

      Example

      DB1 XBC5DDF5_6006ECE \\.\pipe\pipe_mem1DB1 XBC5DDF5_6006ECE \\.\pipe\pipe_mem2
  2. Perform an incremental data backup operation with the database in warm mode.

    1. Perform the backup operation. On the command line, type the following command:

      dbmcli -d testdb -u dbm,dbm -uUTL -c backup_start backpages2

      The software generates an EBID for the job, for example, : XBC5DDF5_6006ECF.

    2. Verify that the dbm.ebf file displays the EBID with the backup pipes.

      Example

      DB1 : XBC5DDF5_6006ECF \\.\pipe\pipe_mem3DB1 : XBC5DDF5_6006ECF \\.\pipe\pipe_mem4
  3. Perform a log backup operation with the database in warm mode.

    1. Perform the backup operation. On the command line, type the following command:

      dbmcli -d testdb -u dbm,dbm -uUTL -c backup_start backlog

      The software generates a EBID for the job, for example, XBC5DDF5_6006ED8.

    2. Verify that the dbm.ebf file displays the EBID with the backup pipes.

      Example

      DB1 XBC5DDF5_6006ED8 \\.\pipe\pipe_mem5
  4. Restore the catalog history and the kernel file (dbm.ebf and dbm.knl) because the files are lost after a disaster occurs.

    1. On the command line, type the following commands:

      UNIX

      root@machine01 Base]# cd /opt/commvault/Base

      [root@machine01 Base]# export BI_CALLER=BACKINT_MAXDB

      Windows

      C:\Users\Administrator>cd C:\Program Files\CommVault\ContentStore\Base

      C:\Program Files\CommVault\ContentStore\Base>set BI_CALLER=BACKINT_MAXDB
    2. Restore the catalog history file and the kernel file (dbm.ebf and dbm.knl). For more information, see Restoring to a Different Client.

      Note: You do not need to set the srcCrossClient and srcCrossDbName parameters in the param file because the source and destination server names are the same for a disaster recovery operation.

  5. Restore the full data backup.

    1. Place the database in admin mode. On the command line, type the following command:

      dbmcli -d DB1 -u dbm,dbm db_admin
    2. Log in to the first dbmcli session with the utility connect and continue until the database is online. On the command line, type the following commands:

      dbmcli -d DB1 -u dbm,dbm -uUTL

      dbmcli on DB1>db_activate recover backdata2 externalbackupid “<EBID of FULL online DATA>”

      Example

      dbmcli -d DB1 -u dbm,dbm -uUTL

      dbmcli on DB1>db_activate recover backdata2 externalbackupid "DB1 XBC5DDF5_6006ECE \\.\pipe\pipe_mem1,DB1 XBC5DDF5_6006ECE \\.\pipe\pipe_mem2"
  6. Restore the incremental data backup. On the command line, type the following command:

    recover_start backpages2 externalbackupid “<EBID of INCREMENTAL online data>”

    Example

    dbmcli on DB1>recover_start backpages2 externalbackupid "DB1 XBC5DDF5_6006ECF \\.\pipe\pipe_mem3,DB1 XBC5DDF5_6006ECF \\.\pipe\pipe_mem4"
  7. Restore the log backup. On the command line, type the following command:

    recover_start backlog externalbackupid “<EBID of LOG>”

    Example

    dbmcli on DB1>recover_start backlog externalbackupid "DB1 XBC5DDF5_6006ED8 \\.\pipe\pipe_mem5"
  8. Bring the database back online. On the command line, type the following commands:

    dbmcli on DB1>recover_ignore

    OK

    Returncode 0

    Date 20180717

    Time 00190755

    Server winls1.example.loc

    Database DB1

    Kernel Version Kernel 7.9.09 Build 008-123-261-855

    Pages Transferred 32440

    Pages Left 0

    Volumes 1

    Medianame BackLog

    Location \\.\pipe\pipe_mem5

    Errortext

    Label LOG_000000001

    Is Consistent

    First LOG Page 0

    Last LOG Page 32694

    DB Stamp 1 Date 20180716

    DB Stamp 1 Time 00151147

    DB Stamp 2 Date 20180716

    DB Stamp 2 Time 00151423

    Page Count 32422

    Devices Used 1

    Database ID winls1.example.loc:DB1_20180716_151159

    Max Used Data Page

    Converter Page Count

    ---

    dbmcli on DB1>db_state

    OK

    State

    ONLINE

Cold Database (offline)

  1. Put the database in cold (offline) mode and perform a full data backup operation.

    1. Perform the backup operation. On the command line, type the following commands:

      dbmcli -d DB1 -u dbm,dbm db_cold

      ddbmcli -d DB1 -u dbm,dbm -uUTL -c backup_start backdata2

      The software generates an EBID for the job, for example, XBC5DDF5_6006ECA.

    2. Verify that the dbm.ebf file displays the EBID with the backup pipes.

      Example

      DB1 XBC5DDF5_6006ECA \\.\pipe\pipe_mem1DB1 XBC5DDF5_6006ECA \\.\pipe\pipe_mem2
  2. Perform an incremental data backup operation with the database in cold mode.

    1. Perform the backup operation. On the command line, type the following command:

      dbmcli -d testdb -u dbm,dbm -uUTL -c backup_start backpages2

      The software generates an EBID for the job, for example, XBC5DDF5_6006ECB.

    2. Verify that the dbm.ebf file displays the EBID with the backup pipes.

      Example

      DB1 XBC5DDF5_6006ECB \\.\pipe\pipe_mem3DB1 XBC5DDF5_6006ECB \\.\pipe\pipe_mem4
  3. Restore the catalog history file and the kernel file (dbm.ebf and dbm.knl), because the files are lost after a disaster occurs.

    1. On the command line, type the following commands:

      UNIX

      [root@machine01 Base]# cd /opt/commvault/Base

      [root@machine01 Base]# export BI_CALLER=BACKINT_MAXDB

      Windows

      C:\Users\Administrator>cd C:\Program Files\CommVault\ContentStore\Base

      C:\Program Files\CommVault\ContentStore\Base>set BI_CALLER=BACKINT_MAXDB
    2. Restore the catalog history file and the kernel file (dbm.ebf and dbm.knl). For more information, see Restoring to a Different Client.

      Note: You do not need to set the srcCrossClient and srcCrossDbName parameters in the param file because the source and destination server names are the same for a disaster recovery operation.

  4. Restore the full data backup.

    1. Place the database in cold mode. On the command line, type the following command:

      dbmcli -d DB1 -u dbm,dbm db_cold
    2. Refresh the data and the log volumes: On the command line, type the following command:

      dbmcli -d DB1 -u dbm,dbm db_activate
    3. Place the database in cold mode. On the command line, type the following command:

      dbmcli -d DB1 -u dbm,dbm db_cold
    4. Log in to the first dbmcli session with the utility connect and continue until the database is online. On the command line, type the following commands:

      dbmcli -d DB1 -u dbm,dbm -uUTL

      dbmcli on DB1>recover_start backdata2 externalbackupid “<EBID of FULL offline DATA>”

      Example

      dbmcli -d DB1 -u dbm,dbm -uUTL

      dbmcli on DB1>recover_start backdata2 externalbackupid "DB1 XBC5DDF5_6006ECA \\.\pipe\pipe_mem1,DB1 XBC5DDF5_6006ECA \\.\pipe\pipe_mem2"
  5. Restore the incremental data backup. On the command line, type the following commands:

    dbmcli on DB1>recover_start backpages2 externalbackupid “<EBID of INCRMENTAL offline data>”

    Example

    recover_start backpages2 externalbackupid "DB1 XBC5DDF5_6006ECB \\.\pipe\pipe_mem3,DB1 XBC5DDF5_6006ECB \\.\pipe\pipe_mem4"
  6. Bring the database online. On the command line, type the following commands:

    dbmcli on DB1>db_execute clear log

    OK

    ---

    dbmcli on DB1>db_online

    OK