Synchronizing the primary and standby databases

One high availability strategy is to have a primary database and a secondary or standby database to take over operations if the primary database fails. If the standby database must take over database operations for a failed primary database, it must contain exactly the same data, know about all inflight transactions, and otherwise continue database processing exactly the same way as the primary database server would, if it had not failed. The ongoing process of updating the standby database so that it is a copy of the primary database is called synchronization.

Before you begin

Before you can synchronize the primary and standby databases you must:

  • Create and configure the primary and standby databases.

  • Configure communications between the primary and standby databases.

  • Choose a synchronization strategy (for example, log shipping, log mirroring, suspended I/O and disk mirroring, or HADR.)

    There are several strategies for keeping the primary database server and the standby database server synchronized:

    • shipping logs from the primary database to the standby database and rolling them forward on the standby database;

    • writing database logs to both the primary and standby databases at the same time, known as log mirroring;

    • using suspended I/O support with disk mirroring to periodically taking a copy of the primary database, splitting th mirror and initializing the copy as a new standby database server; and

    • using a availability feature such as the Db2® High Availability Disaster Recovery (HADR) feature to keep the primary and standby database synchronized.

Procedure

  1. If you are using logs to synchronize the primary database and the secondary or standby database, configure Db2 database to perform the required log management for you.
    For example, if you want Db2 database to mirror the logs, set the mirrorlogpath configuration parameter to the location where you want the second copy of the logs to be saved.
  2. If you are using Db2 database suspended I/O functionality to split a disk mirror of the primary database, you must do the following:
    1. Initialize the disk mirroring for the primary database.
    2. When you need to split the mirror of the primary database, follow the instructions in the topic Using a split mirror as a standby database.
  3. If you are using the HADR feature to manage synchronizing the primary and standby databases, configure Db2 database for HADR, and allow Db2 database to synchronize the primary and standby databases for you.