IBM Books

DB2 Replication Guide and Reference


The Capture Program

The Capture program is the replication tool that captures the changed data and makes the changed data available for replication. The Capture program runs at the source server database.

The Capture program captures changes made to data in replication source tables by reading the database log or journal. It places the captured changes into change data tables. There is only one Capture program at each domain of the database directory, that is, one Capture program in each of the following domains:

The Capture program usually runs continuously, but you can stop it while running utilities or modifying replication sources. The Capture program runs independently of the Control Center, but uses control information created by the Control Center.

Tasks that you can perform with the Capture program include:

See the Capture and Apply chapter for your Capture program platform for instructions about performing these tasks.

How the Capture Program Captures Changes

DB2 records every transaction in a log file for diagnostic and recovery purposes. The Capture program monitors the DB2 log to detect change records from source tables that are defined as replication sources. The Capture program retrieves change and commit information from the active and archive logs on DB2 for MVS 4.1 or higher and DB2 Universal Database. (2) These records contain a before-image and after-image of the table row. The Capture program captures these changes in the change data (CD) tables. The Capture program also maintains information about committed units of work in the unit-of-work (UOW) table. This table is joined with the CD table to identify and replicate committed updates. The Apply program can then copy the committed updates to the target site and apply them to the copy of the source table (the target table). Figure 4 shows the relationship between the Capture program, the DB2 log, the source table, and the control tables.

Figure 4. The Capture Program at the Source Server. The Capture program at the source server reads the DB2 log and captures changed data in the change data (CD) table.
The Capture program at the source server

Control Tables Used by the Capture Program

The Capture program uses control tables to manage capturing changes from multiple source tables. These tables are created when you set up administration with the Control Center. The control tables used by the Capture program are located at the source server. The following list describes the source server control tables:

Register
Contains the name of the source table and the name of the change data table associated with the source table.

Critical section
Contains the Apply qualifier and is used for concurrency control between the Capture and Apply programs.

Tuning parameters
Contains performance tuning information specific to the Capture program.

Trace
Contains trace information for the Capture program.

Unit-of-work (UOW)
Contains committed unit-of-work information used by the Apply program.

Pruning control
Contains information about how far through the CD table the Apply program has progressed in replicating changes to the target tables. The Capture program uses this information to prune the CD table.

Warm start
Contains information about the units-of-work in progress and starting sequence information necessary for restarting the Capture program without performing a full refresh.

Change data (CD)
Contains the changed data read by the Capture program from the database log or journal, and is a source for update copies. There is one CD table for each replication source table.

These tables are described in more detail in Chapter 19. Table Structures.


Footnotes:

(1) For DB2 for MVS/ESA Version 4.1 or higher, only one instance of the Capture program can run for all subsystems that are members of a data-sharing group because tables in a data-sharing group are shared among multiple subsystems.

(2) Capture for MVS can retrieve only the active log on DB2 for MVS 3.1. Capture for VSE and VM 5.1 can read only the active log on DB2 for VSE & VM.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]