Procedure documentationSetting Up and Updating Standby Instances Locate this document in the navigation structure

 

To generate a standby instance, you first import a complete data backup, followed by all subsequent log backups from one database instance (original instance) into another database instance (standby instance). You do not have to stop the original instance to set up a standby instance. It remains operable throughout.

For security reasons, the original instance and the standby instance are located on different database computers.

First you create a new database instance to be set up as the standby instance.

For this standby instance, you define a backup template for a complete data backup and a backup template for a log backup. The values defined for the properties type,backup type, size restriction, block size and overwrite in these two templates have to be identical to the values of the backup template used to create the backup of the original instance. You can enter any name for the backup template name; the data carrier (device/file) property must refer to the location where the complete data backup or the log backups of the source database are stored.

You now import the complete data backup into the standby instance and thereby initialize it.

The standby instance is now ready for regular imports of the log backups. We recommend that you automate this process using scripts, but you can also import log backups manually.

You determine which backup is to be imported next from the data in the restart information and the backup history.

Note Note

If at any point since initialization you have unintentionally transferred the database instance to the ONLINE operational state while importing the data backup, you have to restart the import of the complete data backup with initialization.

End of the note.
Scenario

You want to generate a standby instance TESTDB for your database instance DEMODB. You have created a complete data backup of DEMODB using a backup template with the following properties:

Name: DemoDataCompl

Data carrier (device/file): Backups 2005\Data\completeJan

Type: file (FILE)

Backup type: complete data backup (DATA)

Size restriction: none (0)

Block size: 6

Overwrite: no (NO)

You continually back up the log entries from DEMODB using the backup template DemoFileLog with the following properties:

Data carrier (device/file): Backups 2005\Data\logBackup

Type: file (FILE)

Backup type: automatic log backups (AUTO)

Size restriction: none (0)

The backup history tells you that the log page with the number 37746 will be imported after the data backup and that this log page must be located in the log backup with the version number 018.

DEMODB is on computer GENUA. TESTDB should be created on the local computer. GENUA and the local computer are compatible.

Prerequisites

You can find the prerequisites under Database Manager CLI, db_activate RECOVER,

recover_start,

recover_replace

Procedure

  1. Create the new database instance TESTDB:

    Use the version of the database software that you used to create DEMODB. Configure TESTDB with the same parameter values as DEMODB.

    See: Creating and Configuring a Database Instance

  2. Call the Database Manager CLI in session mode, log on as operator DBM with password DBM, and connect to database instance TESTDB.

    >dbmcli –u DBM,DBM –d TESTDB

    dbmcli on TESTDB>

  3. Define a backup template for a complete data backup:

    Define the new backup template with the same properties as the one used to create the complete data backup of DEMODB. One exception is the property Data carrier (device/file). Here the path has to point to the location where the complete data backup of DEMODB is stored:

    Name of backup template: DataSave

    Data carrier (device/file): \\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\completeDataJan

    Type: file (FILE)

    Backup type: complete data backup (DATA)

    Size restriction: none (0)

    Block size: 6

    Overwrite: no (NO)

    dbmcli on TESTDB>medium_put DataSave "\\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\completeDataJan" FILE DATA 0 6 NO

  4. Define a backup template for a log backup:

    Define the new backup template with the same properties as the one used to create the log backups of DEMODB. One exception is the property Data carrier (device/file). Here the path has to point to the location where the files of the log backups of DEMODB are stored:

    Name of the backup template: LogSave

    Data carrier (device/file): \\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup

    Type: file (FILE)

    Backup type: log backups (LOG)

    Size restriction: none (0)

    Block size: 6

    Overwrite: no (NO)

    dbmcli on TESTDB>medium_put LogSave "\\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup" FILE LOG 0

  5. Transfer TESTDB to the ADMIN operational state:

    dbmcli on TESTDB>db_admin

    OK

  6. Open a database session:

    dbmcli on TESTDB>db_connect

    OK

  7. Import the complete data backup from DEMODB with initialization of TESTDB:

    dbmcli on TESTDB>db_activate RECOVER DataSave

    OK

    Returncode 0

    Date 20060309

    Time 00100407

    Server GENUA

    Database DEMODB

    Kernel Version Kernel 7.6.00 Build 016-123-109-428

    Pages Transferred 13632

    Pages Left 0

    Volumes 1

    Medianame datasave

    Location \\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\completeDataMay

    Errortext

    Label DAT_000000017

    Is Consistent true

    First LOG Page 37746

    Last LOG Page

    DB Stamp 1 Date 20060308

    DB Stamp 1 Time 00160527

    DB Stamp 2 Date

    DB Stamp 2 Time

    Page Count 13610

    Devices Used 1

    Database ID PARMA:DEMODB_20060125_165646

    Max Used Data Page 0

  8. Start the import of the log backups:

    dbmcli on TESTDB>recover_start LogSave 018

    OK

    Returncode -8020

    Date 20060309

    Time 00100728

    Server GENUA

    Database DEMODB

    Kernel Version Kernel 7.6.00 Build 016-123-109-428

    Pages Transferred 1000

    Pages Left 0

    Volumes 1

    Medianame logsave

    Location \\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup.018

    Errortext

    Label LOG_000000018

    Is Consistent

    First LOG Page 35382

    Last LOG Page 37747

    DB Stamp 1 Date 20060208

    DB Stamp 1 Time 00110215

    DB Stamp 2 Date 20060308

    DB Stamp 2 Time 00160655

    Page Count 2365

    Devices Used 1

    Database ID GENUA:DEMODB_20060125_165646

    Max Used Data Page

  9. Start the import of the next log backup:

    dbmcli on TESTDB>recover_replace LogSave "\\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup.019"

    OK

    Returncode -8020

    Date 20060309

    Time 00100728

    Server GENUA

    Database DEMODB

    Kernel Version Kernel 7.6.00 Build 016-123-109-428

    Pages Transferred 2152

    Pages Left 0

    Volumes 1

    Medianame logsave

    Location \\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup.019

    Errortext

    Label LOG_000000019

    Is Consistent

    First LOG Page 37748

    Last LOG Page 40013

    DB Stamp 1 Date 20060308

    DB Stamp 1 Time 00160725

    DB Stamp 2 Date 20060308

    DB Stamp 2 Time 00160758

    Page Count 2265

    Devices Used 1

    Database ID GENUA:DEMODB_20060125_165646

    Max Used Data Page

  10. Start the import of the next log backup:

    dbmcli on testdb1>recover_replace LogSave "\\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup.020"

    OK

    Returncode -8020

    Date 20060309

    Time 00100728

    Server GENUA

    Database DEMODB

    Kernel Version Kernel 7.6.00 Build 016-123-109-428

    Pages Transferred 704

    Pages Left 0

    Volumes 1

    Medianame logsave

    Location \\GENUA\Documents and Settings\All Users\Application Data\sdb\data\wrk\DEMODB\Backups 2005\Data\logBackup.020

    Errortext

    Label LOG_000000020

    Is Consistent

    First LOG Page 40014

    Last LOG Page 40772

    DB Stamp 1 Date 20060308

    DB Stamp 1 Time 00160758

    DB Stamp 2 Date 20060308

    DB Stamp 2 Time 00163132

    Page Count 758

    Devices Used 1

    Database ID GENUA:DEMODB_20060125_165646

    Max Used Data Page

    ...

    ...

Result

You have set up the standby instance TESTDB for the original instance DEMODB.

The first DBM operator for TESTDB has user name DBM and password DBM. The database system administrator of TESTDB has user name DBADMIN and password SECRET.

DEMODB remains in the ONLINE operational state.

Note Note

TESTDB has to stay in the ADMIN operational state until it is started as the active instance.

End of the note.

The dataset from DEMODB has been copied to TESTDB.

To use TESTDB as a standby instance for DEMODB, you must continuously import all subsequent log backups from DEMODB into TESTDB. You can import subsequent log backups as described or automatically using a script.

If necessary, you can start TESTDB as the active instance.