Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2003
    Posts
    11

    Unanswered: Data replication algorithm

    Hello

    I am writing a database replicator software to replicate new records from a source DB2 database to a target MySQL database. However, the replication seems to be rather slow, cuz the software basically grabs records from the DB2 database 100,000 at a time and does comparison of the primary keys to see if they exist in the target table.

    I would like to ask if anyone has a better method for doing this job? I was actually thinking of running a small daemon program on the source machine which detects if new records have been added and then zaps these records over to the target machine but the source machine seems a little overloaded at the moment.

    Thanks a lot for the help! Really appreciate it.

    Kind regards,
    A340-313X

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    You could create triggers on the DB2 tables which would log inserts, updates, and deletes to another DB2 table (with an extra column to indicate insert, update, or delete). Then you would have a table of just the items that changed on the table. Obviously you would want to delete the rows off the DB2 log table as you posted them to MySQL.

  3. #3
    Join Date
    Aug 2003
    Posts
    11
    Thanks for your prompt reply!

    Is there any other way other than triggers? The only problem is I don't seem to have sufficient control over the DB2 database to create stuff like triggers. If not, thanks a lot anyway!

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    There may be software packages available that read the logs and output them in a user friendly way. But I don't have any specifics on that.

    IBM offers a product called DataPropagator, but I believe it only works on DB2 mainframe. I would check out the DB2 Replication Guide. Maybe others have an idea that might help you.

  5. #5
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Here is an IBM Redbook that may be of Interest:
    "A Practical Guide to DB2 UDB Data Replication V8"

    http://publib-b.boulder.ibm.com/Redb...=0,replication

  6. #6
    Join Date
    Mar 2003
    Posts
    343
    There's a tool called recovery expert which can read db2 logs and create undo statements - I do not know whether it can generate redo statements. I's worth a shot.

Posting Permissions

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