martedì 12 aprile 2016

Using external sources with IBM InfoSphere Change Data Capture

The tool allows the user to use also external loads of data without the constraint to use the tool to mirror or refresh some tables, but it need to mark on the target database the CDC subscription with the start and end rows that have been unloaded from the source.

For example customize the following example and run the CDC commands to mark the rows:


Run on the Source:
Mark before and after exporting the rows from a table.

dmmarkexternalunloadstart -I INSTANCE_NAME -s SUBSCRIPTION_NAME -t TABLE1

db2 export to /tmp/TABLE1.ixf of ixf messages /tmp/TABLE1_msgs.txt "select * from TABLE1

dmmarkexternalunloadend -I INSTANCE_NAME -s SUBSCRIPTION_NAME -t TABLE1

Copy the file /tmp/TABLE1.ixf from source to the target machine


Run on the Target:
Inport the data exported into the target

db2 import from /tmp/TABLE1.ixf of ixf messages /tmp/TABLE1_msgs.txt insert into TABLE1


Start Mirroring:
On the CDC console start the mirroring on the CDC subscription specified. This allows to transfer all new or updated rows that have been inserted, updated or deleted during the transient time of the exporting operation.


As alternative of exporting all tables from the source, it can be also executed a backup on the source, and a restore on the target.

Nessun commento:

Posta un commento