Parallel Apply

Parallel Apply is a procedure that allows CDC LUWs and bulk data to be applied in parallel into a target database to improve throughput.

CDC LUWs:
CAUTION: Using this procedure can no longer ensure the referential integrity of the data in the target database. All LUWs are applied correctly, but the chronological order in which the LUWs are applied is no longer guaranteed.

The procedure consists of a CDC log reader script, which writes the log data in stage 1 with the LUW manager active into an output pipe.

The procedure for the CDC log reader script is activated with the parameter PARALLEL_APPLY_MAX_SLOTID = n. The LUWs are given a SlotID, which takes values from 1 to n.

With these marked LUWs, several Apply scripts can now read out the pipe in parallel and, due to the SlotID, only apply selected LUWs into the target database.

The parameter PARALLEL_APPLY_CHECK_SLOTID determines which SlotIDs an Apply script should process. All other SlotIDs are skipped because they are processed by other Apply scripts.

It must be ensured that the various Apply scripts cover all SLOTIDs assigned by the CDC log reader script exactly once. Otherwise, LUWs that have not been selected will not be applied into the target database or LUWs that have been covered more than once will be applied into the target database more than once.

Bulk data

The procedure consists of bulk apply scripts, which read bulk data directly from a source database backup (e.g. Db2 ICOPY etc.) or as stage 0 data from a Rocket® Data Replicate and Sync file or pipe.

The procedure for bulk apply scripts is activated with the parameter PARALLEL_APPLY_MAX_SLOTID = n. The bulk records are given a SlotID, which takes values from 1 to n.

With these marked bulk records, each bulk apply script can now read out the bulk data in parallel and, based on the SlotID, only apply selected bulk records into the target database.

The parameter PARALLEL_APPLY_CHECK_SLOTID determines which SlotIDs a bulk apply script should select. All other SlotIDs are skipped because they are processed by the other bulk apply scripts.

It must be ensured that the various bulk apply scripts all use the same value n for the parameter PARALLEL_APPLY_MAX_SLOTID = n and cover all assigned SLOTIDs exactly once. Otherwise, unselected bulk records will not be applied into the target database, or bulk records that have been covered several times will be applied into the target database more than once.