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 > Db2 Replication

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-29-04, 05:16
gulshan_gandhi gulshan_gandhi is offline
Registered User
 
Join Date: Jun 2003
Posts: 24
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
Reply With Quote
  #2 (permalink)  
Old 04-29-04, 08:16
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Gulshan,
Yes there needs to be a unique index. How do yo expect DB2 to Update or Delete the proper row without one?

Andy
Reply With Quote
  #3 (permalink)  
Old 04-29-04, 08:57
J Petruk J Petruk is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 04-29-04, 10:07
gulshan_gandhi gulshan_gandhi is offline
Registered User
 
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 ?
Reply With Quote
  #5 (permalink)  
Old 04-29-04, 10:38
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
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
Reply With Quote
  #6 (permalink)  
Old 04-30-04, 03:58
gulshan_gandhi gulshan_gandhi is offline
Registered User
 
Join Date: Jun 2003
Posts: 24
DB2 replication

Thanks for all the help. I would use log forwading instead.
Reply With Quote
  #7 (permalink)  
Old 05-01-04, 22:13
hanyheggy hanyheggy is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 05-04-04, 04:59
gulshan_gandhi gulshan_gandhi is offline
Registered User
 
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.
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