Q subscriptions
You create objects called Q subscriptions to define how data from a single source table is replicated to a single target table or is passed to parameters in a stored procedure for data manipulation.
The Q subscription tells the replication programs which changes to capture from the source table, what queues to use for sending and receiving change messages, and how to process the messages. Figure 1 shows how a Q subscription connects a source table to a target table. Q subscriptions can also map DB2® sources to DB2 targets and DB2 sources to some non-DB2 targets. Figure 2 shows how a Q subscription connects a source table to a target table for non-DB2 targets.
You must create a Q subscription for each source-to-target pair. Each Q subscription is a single object that identifies the following information:
- The source table that you want to replicate changes from.
- The target table or stored procedure that you want to replicate changes to.
- The columns and rows from the source table that you want to be replicated.
- The replication queue map, which names the MQ queues that transport information between the source server and target server.
For Q subscriptions, you can specify the following options:
- Which columns to replicate and how they map to columns at the target table (or to parameters in a stored procedure).
- A search condition to determine which rows from the source table are replicated.
- How the Q Apply program detects and responds to conflicts between rows at the source and target database.
- How the target table will be loaded with data from the source table.
Q subscriptions for either bidirectional or peer-to-peer replication must replicate all columns in the source table. These types of replication also require specific types of conflict detection and conflict handling.
If you make changes to a Q subscription after you create it, you need to reinitialize it so that the Q Capture program reads the changes.