Application of data to Db2® targets in SQL Replication
To start replicating data from sources to targets, you start the Apply program. After you do so, the Apply program begins processing the subscription sets that you assigned to it. The Apply program processes any active subscription sets one at a time, according to the scheduling or event criteria that you specified when you created the subscription sets.
For example, if you chose to replicate subscription set Set_One every 60 minutes, the Apply program will replicate that subscription set as close to every 60 minutes as possible. If the Apply program has other work to finish when the 60–minute interval elapses, Set_One will be replicated as soon as the Apply program finishes its other work.
- For sources that you registered for change-capture replication
- The first time that the Apply program processes the corresponding subscription
set, the Apply program can populate the targets with the content of the sources.
You can tell the Apply program to call one or more utilities, such as the
EXPORT and LOAD utilities, to populate the targets. The utilities that the
Apply program chooses depends on the platform on which the Apply program is
running.
Then, at the time intervals that you specified when you created your subscription sets or whenever an event occurs, the Apply program reads the CD tables of your sources for rows that were inserted into the CD table since the Apply program last looked. The rows in the CD tables indicate whether they are records of deletes, updates, or inserts to the corresponding sources.
The Apply program uses the data from the CD table to insert, update, and delete rows in the target. Predicates are used to identify the rows to be updated or deleted.
- For sources that you registered for full-refresh replication
- At intervals that you specify the Apply program populates the targets with the content of the sources. You can tell the Apply program to call one or more utilities, such as the EXPORT and LOAD utilities, to refresh your target tables. The utilities that the Apply program chooses depends on the platform on which the Apply program is running.
The following figure shows the Apply program applying data in a simple configuration in SQL Replication.
