Materializing the standby database

Transaction replication requires a “starting point,” where the primary and standby databases are identical, with the same data and schema. If the standby database is not identical to the primary database, it must be materialized before transaction replication begins.

With integrated disk replication, you can materialize the standby database by copying a snapshot of the primary data and log devices to the standby site. After the snapshot is received at the standby site, the standby database can be brought online.

Figure 1-3 illustrates how snapshot data moves from devices at the primary site to devices at the standby site, to materialize the standby database.

Figure 1-3: Standby database materialization

To materialize the standby database, the primary database must be quiesced, so that all client applications are locked out of the database, any transactions in progress are frozen, and the primary data and log devices are stabilized.

While the primary database is quiesced, the disk replication system captures a snapshot image of the primary data and log devices. The disk replication system copies the snapshot to the standby data and log devices, which loads the standby database with data and schema that are identical to the primary database.

After materializing the standby database, the disk replication system disconnects from the standby devices, and sends an additional copy of the primary log device snapshot to materialize the mirror log devices. Then, the disk replication system is set to mirror (or synchronously replicate) all subsequent changes on the primary log devices to the mirror log devices, which are the source of all transactions replicated by the Mirror Activator system.

After the snapshot is captured at the primary site, and before primary database access is restored to other client applications, the Mirror Activator system executes a procedure in the primary database to place a marker in the transaction log. The Mirror Activator system uses the log marker to identify its “starting point” for transaction replication.

After the marker is recorded in the primary database transaction log, primary database access for client applications can be restored.

NoteYou can use a similar materialization process to restore the primary database after failover to the standby.