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 database link / linked server equivalent

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-03-11, 06:07
surfjungle surfjungle is offline
Registered User
 
Join Date: Apr 2007
Posts: 17
DB2 database link / linked server equivalent

Hi all,

I'm looking to see if DB2 provides the same functionality as Oracle's "Database Link" and SQL Server's "Linked Server".

I have two different DB2 9.7 machines - machineA and machineB. I want to copy the rows of a particular table in machineA into the same table in machineB. The Oracle / SQL Server SQL looks similar to the following, assuming the links have been set up:
INSERT INTO machineB.userB.tableZ SELECT * FROM machineA.userA.tableZ

Note that I have already successfully implemented the a feature using links for Oracle and SQL Server. I just find it hard to believe that there is not somehting similar for DB2. I have tried Googling but came up with some vague results. Your help and advice is appreciated.

Thanks and kind regards,
Jason.
Reply With Quote
  #2 (permalink)  
Old 03-03-11, 09:08
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
In DB2 it is called Federation. Check it out in the manuals.

Andy
Reply With Quote
  #3 (permalink)  
Old 03-03-11, 09:11
surfjungle surfjungle is offline
Registered User
 
Join Date: Apr 2007
Posts: 17
Hi Andy,

Thanks for that. I've read about federation as a solution on several websites including this one and am currently looking into it.

I'm assuming it's like database link / server link but a bit more involved?

Kind regards,
Jason.
Reply With Quote
  #4 (permalink)  
Old 03-03-11, 09:14
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I do not know the Oracle or SQL Server methods. But to access a table on a remote database as if it was part of the connected database, in DB2 you use Federation.

Andy
Reply With Quote
  #5 (permalink)  
Old 03-03-11, 09:15
surfjungle surfjungle is offline
Registered User
 
Join Date: Apr 2007
Posts: 17
Excellent Andy! Thank you kindly.

Jason.
Reply With Quote
  #6 (permalink)  
Old 10-23-11, 10:05
surfjungle surfjungle is offline
Registered User
 
Join Date: Apr 2007
Posts: 17
Hi all,

Thanks for the help. Many months ago I successfully implemented DB2 federation to link two remote database servers together. I have since written an entry on my blog about how I achieved it. I hope people find it useful and that it saves them time.

Surfjungles Technology Blog: Linking DB2 databases together via federation

Kind regards,
Jason.
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