Reorganizing an IBM i file changes the physical positions of all the records in the file, which can change the relative record number of each record. This is likely to invalidate the mapping of the source and target table key values if the RRN column is used as the distribution key. Consequently, whenever such a reorganization occurs, you must resynchronize the source and target tables.
To preserve the integrity of your distributed data, Connect CDC automatically detects a file reorganization through the source table journal, and stops capturing data so you can resynchronize the tables. The Db2 for IBM i/400 Change Selector issues a message and shuts down if it sees an F/RG record, which is written to the journal receiver when a file reorganize command (RGZPFM) completes.
The following procedure is recommended to coordinate your file reorganization and table resynchronization with Connect CDC processing:
Start the file reorganization.
Let the DB2/400 Change Selector detect the reorganize command in the journal and shut itself down.
Let Connect CDC Kernel continue running to flush all data from the metabase queue tables.
Stop Connect CDC Kernel when the queue tables are empty.
If the source and target tables are protected, delete all rows from their shadow tables.
Start a request in the monitoring and control tool of your choice to resynchronize the source and target tables.
Start the Change Selector.
When the data copy completes, open the source table to user updates, and start replication.