Unidirectional replication
With unidirectional replication, you replicate data from source tables to target tables or stored procedures.
- Transactions that occur at a source table are replicated over IBM® MQ queues to a target table or are passed as input parameters to a stored procedure to manipulate the data.
- Transactions that occur at the target table are not replicated back to the source table.
- The target table typically is read only or is not updated by applications other than the Q Apply program.
The Q Capture program replicates transactions from a source table and puts those transactions on a send queue in compact format; then the Q Apply program gets the compact messages from a receive queue and applies the transactions to a target table (either a DB2® table or a nickname on a DB2 federated server), or passes them to a stored procedure.
From any source table, you can replicate either all of the columns and rows or only a subset of the columns and rows. If you want to transform the data, you can specify for the Q Apply program to pass the transactions from a source table as input parameters to a stored procedure that you provide. The stored procedure can update data in either a DB2 or non-DB2 server.
- Replication queue maps
- You must create at least one replication queue map to transport data from the Q Capture program on the source server to the Q Apply program on the target server (or the DB2 federated server if you are replicating to a non-DB2 target table).
- Q subscriptions
- There is one Q subscription for every pair of source and target
tables or every pair of source tables and stored procedures. For example,
if you have a source table on SERVER_RED, a target table on SERVER_GREEN,
and another target table on SERVER_BLUE, there are two Q subscriptions:
- One from the source table on SERVER_RED to the target table on SERVER_GREEN
- One from the source table on SERVER_RED to the target table on SERVER_BLUE
Figure 1 shows what you get by mapping three source tables to three target tables at one time for unidirectional replication. In this example, there are three separate Q subscriptions. Changes from Source A are replicated to Target A, changes from Source B are replicated to Target B, and so on. Changes from Source A cannot be replicated to Target B. These source-and-target pairs use the same replication queue map, Q Capture program, and Q Apply program.