Hi.  I recently finished a project for a client who needed Update-Anywhere Repliction on one table between 4 DB2 version 9.1 databases at different locations.   I thought I would share a high-level overview of the process I used, starting with 2-way replication between the first 2 databases.

I started with one Master database and one Replica.  I set it up so that the Master could replicate changes to multiple Replicas as I added more.  It is simply a matter of using the recapture option at the Master so that changes that occur at one Replica are recaptured at the Master and forwared to the other Replica tables.  So, I turned on recapture at the Master and turned it off at the Replicas.

These are the basic steps I started with for one Master and one Replica.  The other two replicas were added in much the same way.

  1. I set up server communications by cataloging the Master node and db on the Replica and visa versa.
  2. I used the Replication Center on the Master server for the rest of this process.  I first had to configure the ‘Manage Passwords and Connectivity’ section by adding each node and database with the id’s and passwords.
  3. Create Capture control tables on the Master database using the Replication Center using the ‘Quick’ option.
  4. Register a table on the Master for Replication.  I used all the defaults except I change the ‘Conflict detection level to ‘Standard’
  5. Create the Apply control tables on the Replica using the same method.
  6. Create a Subscription Set on the Apply control server (Replica).  When you configure the Source to Target mapping, you change the target type to ‘Replica’
  7. After creating the source as a Replica, you will see that your Replica database also shows up as a Capture server now.  This is because both Apply and Capture will be running here so that changes can be captured and applied to the Master.
  8. You can now open up the Capture Properties of the Replica table and uncheck the ‘Capture changes from replica target table’ box.  This should only be checked on the Master.
  9. Start Capture on the Master server
  10. Start Apply on the Replica
  11. Start Capture on the Replica

The Master database will only have Capture processes running.  Each Replica database will have both Capture and Apply.

There were only about 5k – 10k rows updated on this table per day so I didn’t have a good load to check performance.  I can say that we had no problems with conflicts and scheduling replication to update every 2 minutes worked well.

Lesson Learned:  The table we replicated had a generated IDENTITY column.  This can’t be set up to replicate to a Replica table.  I got around it by setting up the IDENTITY field so that it numbered from 1 – 999999 on the Master and 1000000 – 1999999 on the Replica.  As I added more Replicas I change the Identity start number to 2000000 as so on.  Then when setting up the Column Mapping on the Replica Apply database I didn’t replicate the ID column.  It was simply generated upon insert.

I found that using DB2 Replication Center was a pretty simple way to set up 2-way replication and then add more Replicas for Update-Anywere replication.  Starting Capture and Apply and reading logs was easier at the command line.

Let me know if you have any questions I could try to answer.  Thanks!

Share This