Creating Q subscriptions for unidirectional replication
By creating Q subscriptions for unidirectional replication, you define how data from source tables is replicated to target tables or is passed to parameters in a stored procedure for data manipulation.
Before you begin
- Plan how you want to group replication queue maps and Q subscriptions.
- Create the control tables for the Q Capture program in the server that contains the source table for the Q subscription.
- Create the control tables for the Q Apply program in the server that contains the target for the Q subscription.
- Specify the queues for replicating and their attributes by creating a replication queue map. (You can do this task before you create a Q subscription or while you create a Q subscription.)
- Prepare the stored procedure if you want the Q Apply program to pass source changes to a stored procedure instead of to a target table.
Restrictions
- Views cannot be sources or targets for Q subscriptions.
- Identity columns in the target table cannot be defined as GENERATED ALWAYS.
z/OS
- Do not select ROWID columns for replication except when the ROWID
column is the only unique index that is specified for replication.
Replication of ROWID columns is not supported for bidirectional or
peer-to-peer replication. Recommendation: Use an identity column rather than a ROWID column as the unique index for replication.If you are replicating LOB columns, you must have an unique index besides the ROWID unique index.
Linux, UNIX, Windows
- Replication is supported from multiple-partition databases. There is no limit to the number of partitions that replication supports.
- Replication is supported from tables that use value compression or row compression. DB2® uncompresses log records before passing them to the Q Capture program. The data is passed uncompressed from source to target and the target does not need to have compression set.
- Replication is supported from materialized query tables (MQTs).
Procedure
To create a Q subscription for unidirectional replication
from one source table to one target table or stored procedure, use
one of the following methods:
Method | Description |
---|---|
ASNCLP command-line program | Use the CREATE QSUB command. For example, the following commands
set the environment and create a Q subscription for unidirectional
replication, EMPLOYEE0001, with the following characteristics:
|
Replication Center | Use the Create Q Subscriptions wizard. To open the wizard,
expand the appropriate Q Capture or Q Apply schema, right click the Q
Subscriptions folder, and select Create. You can create one Q subscription or many by using the wizard.
|