Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2007
    Posts
    17

    Unanswered: 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.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    In DB2 it is called Federation. Check it out in the manuals.

    Andy

  3. #3
    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.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    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

  5. #5
    Join Date
    Apr 2007
    Posts
    17
    Excellent Andy! Thank you kindly.

    Jason.

  6. #6
    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.

  7. #7
    Join Date
    Jun 2015
    Posts
    10
    Hi All ,

    I am facing similar issue. Came across this blog.

    I also need to run one sql form remote database machine 1 into our database machine 2

    Please suggest me what should be my approach.I am new to db2

  8. #8
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    as indicated :
    have a look at infocenter/knowledge center and check for federation server
    commands : create wrapper-create server..-create user mapping - create nickname....
    federation between db2 databases is included in the base code : no feature to install
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  9. #9
    Join Date
    May 2012
    Location
    Canberra, Australia
    Posts
    176
    Provided Answers: 6
    Andy

    "All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can’t get them together again, there must be a reason. By all means, do not use hammer.” — IBM maintenance manual, 1975 "

Posting Permissions

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