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
- 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.
- If you are using DB2 database
suspended I/O functionality to split a disk mirror of the primary
database, you must do the following:
- Initialize the disk mirroring for the primary database.
- 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."
- 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.