Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Location
    Egypt
    Posts
    61

    Unanswered: using replication to move data (not to copy data)

    hi,

    how can i use replication for DB2 V8.1 FP 4 to move the data from source to taget table

    i tried 'user copy' subset replication, but while i delete some rows from the source table, the same rows are deleted from the Target table too

    i need to MOVE the rows from source table to target table, when i delete them from the source it will still found in target table

    anyone can help
    hany heggy,
    IBM certified Professional, AIX system support
    www.melodyhits.tv

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    If all you want is a copy of the data at some point in time, I would suggest that you use some other method like db2move.
    Replication is a way to keep the databases in sync. As long as Apply is running, the data changes on the source will show up on the target. If you insist on using replication, stop Apply when your target copy is in the state you want it to stay in.

    HTH

    Andy

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: using replication to move data (not to copy data)

    Can I read your query as : Replicate only INSERTs

    I can think of a way but never had a chance to test it :

    Define source ST1 and CDT of ST1 is CDT_ST1
    Create a view V_I_CDT_ST1, a view over CDT_ST1 selecting only ibmsnap_operation I
    Define this view as a replication source
    Define a replication target and configure apply to use this source ...

    In this manner, your INSERTs only will be replicated

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  4. #4
    Join Date
    Jan 2004
    Location
    Egypt
    Posts
    61

    Smile

    one way to do this 'Data Moving'

    To replicate the source table SRC1 to taget table TG1 then apply a trigger on the TG1 table (for each row after insert ) to insert the same data into history table HIS1, this history table will contain all the data

    We donot care of deleteing records from SRC1 table as this will reflect only in target table TG1 and will never affect the history table HIS1

    so what do u think ?
    Last edited by hanyheggy; 01-17-04 at 22:27.
    hany heggy,
    IBM certified Professional, AIX system support
    www.melodyhits.tv

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    That sounds far better . ... But may fail if you define updates as deletes and inserts ..

    Cheers
    Sathyaram
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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