When multiple source tables are replicated to a single target table in Q Replication, you use a special procedure to ensure that all of the data from multiple loads is preserved in the target table.
About this task
This procedure allows you to incrementally load the target from multiple sources and ensure that none of the loads overwrite data from previous loads.
When you create Q subscriptions for the source tables, you specify a load type that uses the REPLACE option for one Q subscription, and a load type that uses the RESUME option (z/OS) or INSERT option (Linux, UNIX, and Windows) for all of the other Q subscriptions. Then you start the Q subscription with the REPLACE load type first, and start the other Q subscriptions after the first load is finished.
The first load replaces any data in the target table, and the subsequent loads add data from the other source tables without affecting the data from the first load.
Table 1 shows the load types that you should use in combination for this procedure. The load type information is stored in the IBMQREP_TARGETS table.
Load type for first load (with REPLACE option) | Load type for subsequent loads (with RESUME or INSERT option) |
---|---|
1 (LOAD from CURSOR) | 101 |
2 (EXPORT/IMPORT) | 102 |
3 (EXPORT/LOAD) | 103 |
Figure 1 shows how the procedure works for one of these combinations, LOAD from CURSOR with the REPLACE option for the first load and LOAD from CURSOR with the RESUME option for the subsequent loads.
Procedure
If you need to reload the data from only one source table (for example because one Q subscription was in error), manually delete the rows in the target table using a suitable range, set LOAD_TYPE to 101, 102, or 103 for the Q subscription that was in error, and start the Q subscription.
If you need to do a full refresh of the entire target table, follow the procedure above.