Infrastructure for an SQL Replication environment

SQL Replication allows you to replicate data from DB2® sources to targets by using two programs: Capture and Apply.

The Capture program runs on the source system. The Capture program reads DB2 recovery logs for changed source data and saves the committed changed data to staging tables. The Apply program typically runs on the target system. The Apply program retrieves captured data from staging tables and delivers the data to targets. Both programs use a set of DB2 tables to track the information that they require to do their tasks and to store information that they generate themselves, such as information that you can use to find out how well they are performing. You create these tables before you tell SQL Replication what your replication sources and targets are.

The Capture program uses a set of DB2 tables called Capture control tables. These tables contain information about replication sources and the current position of the Capture program in the DB2 recovery log. In most cases, the control tables for a Capture program need to be on the same DB2 server as the sources associated with the program.

You can run multiple Capture programs on the same DB2 server. Each Capture program uses its own set of Capture control tables. The schema associated with a set of Capture control tables identifies the Capture program that uses those control tables. This schema is called a Capture schema.

If your sources are located on a non-DB2 relational database, triggers are used to capture changes to them, though a set of control tables is still required.

The Apply program uses a set of DB2 tables called Apply control tables. These tables contain information about your targets and where their corresponding sources are located. The control tables for the Apply program usually reside on the system where the Apply program runs. Unlike with the Capture program, you can create multiple Apply programs that use the same set of control tables. Each Apply program is identified in these control tables by a name called an Apply qualifier.

For each supported operating system or platform that is supported by DB2 and for each non-DB2 relational database management system that is supported by SQL Replication, you can set your own default specifications for the table spaces that will be used by control tables.

The following figure shows the infrastructure for a simple configuration in SQL Replication.

Figure 1. Infrastructure for a simple configuration in SQL replication. You create a set of DB2 relational tables on the source server called Capture control tables. Information about sources is written to these tables. The Capture program, which runs on the source server, uses this information to know what data it is supposed to capture. Information about targets will go in the Apply control tables, which are typically on your target server. The Apply program, which is also typically on your target server, uses this information to know which targets it is supposed to write data to.
This image shows the infrastructure for a simple configuration in SQL Replication.