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.
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 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:
These tables are described in more detail in Chapter 19. Table Structures.
(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.