Results 1 to 8 of 8

Thread: Db2 Replication

  1. #1
    Join Date
    Jun 2003
    Posts
    24

    Unanswered: Db2 Replication

    Hi,

    I want your opinion/suggestion on what can be done in the below mentioned case.

    Is it true that for replication to work in DB2, at least one unique index is required on the tables selected to replicate. I have tables in the database which do not have anu unique index and I cannot create also.

    Request your suggestion/alternative solution to resolve this problem.

    Regards,
    Gulshan

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Gulshan,
    Yes there needs to be a unique index. How do yo expect DB2 to Update or Delete the proper row without one?

    Andy

  3. #3
    Join Date
    Mar 2004
    Location
    Toronto, ON, Canada
    Posts
    513
    Quote Originally Posted by gulshan_gandhi
    I have tables in the database which do not have anu unique index and I cannot create also.
    Can't you just slap an identity column on it?
    --
    Jonathan Petruk
    DB2 Database Consultant

  4. #4
    Join Date
    Jun 2003
    Posts
    24

    DB2 Replication

    Does slapping identity columns means addition of a new column in the table that would be of integer type and incerement itself by 1 on addition of each row ? The new coulmn can be the unique index for the table.
    If yes, then it would require change in 20 odd database tables and changes in the application code as well

    Are there any other alternatives ?

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    If you use an Identity column in a table that is being replicated, make sure that you use GENERATE BY DEFAULT and not GENERATE ALWAYS. You do not want to have your identity columns change values on the target server.

    Replication requires a unique index to determine which row needs changing. There is no other way around it. If you cannot provide some method of uniqueness for a table that Replication is not the answer you are looking for.

    Andy

  6. #6
    Join Date
    Jun 2003
    Posts
    24

    DB2 replication

    Thanks for all the help. I would use log forwading instead.

  7. #7
    Join Date
    Jan 2004
    Location
    Egypt
    Posts
    61
    just wonder u wanna replica copy ( exact copy of the table in more than one DB ) ?

    or u just need to collect data from some tables to another ?

    i had wrote ODBC based data collection tool under linux and i can provide you with a copy of it

    good luck
    hany heggy,
    IBM certified Professional, AIX system support
    www.melodyhits.tv

  8. #8
    Join Date
    Jun 2003
    Posts
    24

    DB2 replication

    Yes, I want to copy the exact data from one database to another. I am using AIX as O/S and CICS as OLTP.

Posting Permissions

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