Was this helpful?
Change Recorder
The Change Recorder is responsible for recording all changes made to base tables registered for replication. The recording process is accomplished internally in the DBMS, which automatically performs work on behalf of the user. The DBMS manipulates support tables to maintain a history of replicated transactions and a queue of transactions that need to be distributed by the distribution threads. This queue is known as the input queue. The data contained in the support tables is also used for collision resolution.
How the Change Recorder Works
When a user makes a change in a table that has been registered for replication, the Change Recorder function is activated and the following process begins:
1. A replicated transaction key for that row is generated internally.
2. The Change Recorder inserts a new row into the shadow table with the replicated transaction key and the key columns of the base table.
If the change is an insert, the shadow record for this new replicated transaction key contains zeros for the previous replicated transaction key. If the change is an update or delete, the shadow record for this new replicated transaction key contains the replicated transaction key for the previous replication transaction for this row.
3. In full peer situations, if the change is an update or delete, the Change Recorder inserts the previous replicated transaction key and an image of the row associated with this ID into a new row in the archive table. An indicator is set to reflect that the data for the old replication is now in the archive table instead of the base table.
In this way the shadow and archive tables provide the sequential history of every replicated row.
4. The Change Recorder inserts the replicated transaction key into the input queue.
The input queue contains the information necessary to complete the replication, except the destinations.
The following figure illustrates the tasks of the Change Recorder:
Last modified date: 01/30/2023