|Product:||Syniti Data Replication, DBMoto|
|Summary:||How to use IBM i, iSeries, AS/400 RRNs (Relative Record Numbers) instead of primary keys when replicating from Db2.|
You can mirror from IBM Db2 on IBM i to a target database using the RRN (Relative Record Number) values on Db2 tables. You cannot synchronize (bi-directional mirroring) using RRN. Also if a Db2 table is reorganized, the target table needs to be refreshed from the Db2 table before mirroring can proceed again.
For DBMoto versions up to 7.0, there is no check for table re-organization in DBMoto so it is up to the DBMoto administrator to recognize that a refresh needs to occur after a reorganization.
For Syniti Data Replication 9.6 and above/DBMoto 7.0 and above, Syniti DR/DBMoto can report member reorganization in the log. In the Log Settings dialog, check the option Write a warning on member reorganize to record a warning in the Syniti DR/DBMoto log if RGZPFM (reorganized physical member) is executed on a table.
To use RRNs as the primary key for mirroring from IBM Db2 for i:
- Create a Decimal field on the target table and make it the primary key.
- Create source and target connections for the replication.
- Define the replication.
- When mapping source and target fields, right click on the target table field you want to map the RRN to, and choose Map to Expression...
- In the upper pane of the Expression Editor, type [!RecordID].
You can instead expand Values in the lower left hand pane, click on Log Field, then double click on !RecordID in the lower right hand pane. Both methods accomplish the same thing.
- Click OK to save the expression.