If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > using replication to move data (not to copy data)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-04, 10:31
hanyheggy hanyheggy is offline
Registered User
 
Join Date: Jan 2004
Location: Egypt
Posts: 61
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
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 10:56
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #3 (permalink)  
Old 01-14-04, 11:42
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
  #4 (permalink)  
Old 01-15-04, 09:50
hanyheggy hanyheggy is offline
Registered User
 
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 ?
__________________
hany heggy,
IBM certified Professional, AIX system support
www.melodyhits.tv

Last edited by hanyheggy; 01-17-04 at 21:27.
Reply With Quote
  #5 (permalink)  
Old 01-15-04, 10:35
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On