Results 1 to 1 of 1

Thread: Can one use RRN as a replication key

  1. #1
    Join Date
    Sep 2006
    Rep Power

    RRN as replication key

    Can one use RRN as a replication key?

    We are working with DB2/400 CDC and are applying changes to the destination table using the RRN (relative record number) field as the replication key. Occasionally, we see multiple change records with the same RRN that do not make sense. For example, two INSERT operations on the same table, both showing the same RRN (I was expecting that there would be a DELETE of the same RRN before the second INSERT change record).

    It is very tempting to use the RRN of a record as a replication key since it is very simple key and sometimes there is no applicative primary key. However, the RRN is a physical relative number of a record and as such it is not guaranteed to be maintained intact by the database - for example, it may change when the DB2 reorganizes the table to compress deleted rows.

    Therefore, basing the replication on the RRN field is not safe. The DB2/400 journal does contain non-INSERT/UPDATE/DELETE/TRANSACTION entries such as the RG entry which indicates that a physical file memeber was reorganized but these records are not present in the Stream change tables so one cannot use them. As a matter of fact, if such a record would have been found in the change table, the appropriate action would have been to do a full file refresh.

    The current recommendation for replication using Stream is to base the replication on the primary key of the table.
    Last edited by Admin_attu; 01-14-2007 at 08:53 AM.
    By Dror Harari

    To Find Out more About Attunity Technology:
    Contact Us

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts