Results 1 to 7 of 7

Thread: database links

  1. #1
    Join Date
    Sep 2002
    Location
    Austria
    Posts
    37

    Lightbulb Unanswered: database links

    hi all, being rather new to db2: is there some feature like a database link (in Oracle terms), meaning: I have two different databases A and B on the same (or different machine) and I have the chance to acces tables from A and B within a single sql-statement or a single stored procedure.
    thanks for replies, r

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

    Re: database links

    Assuming you are on V7 , there is a concept called Federated Databases ...

    Using this you can have Read-only access tables on a different database (includes DB2,ORacle, Informix, Sybase etc) ....

    HTH

    Sathyaram

    Originally posted by pre4711
    hi all, being rather new to db2: is there some feature like a database link (in Oracle terms), meaning: I have two different databases A and B on the same (or different machine) and I have the chance to acces tables from A and B within a single sql-statement or a single stored procedure.
    thanks for replies, r

  3. #3
    Join Date
    Sep 2002
    Location
    Austria
    Posts
    37

    Re: database links

    thanks for the hint, it works (of course) and you helped us a lot.

  4. #4
    Join Date
    Jul 2003
    Posts
    30

    Database Links

    I am new to Db2 too and ver are using UDB 8.

    I had a question about the database links.
    Lets say I have two DB2 databases A and B on the same server.
    How can I run a stored procedure from Database B which will
    pick up information from Database A and then post it back to Originating database B.

    In Oracle there is a concept of Database Links (Public and Private).
    Do we have something to the same effect.

    Any help in this issue is very well appreciated.

    Thanks
    -Soumil

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

    Re: Database Links

    Soumil,

    There is a recent tutorial in db2 dev domain at

    http://www7b.boulder.ibm.com/dmdd/li...ski/index.html

    This gives a brief note on setup of federated servers ..

    1. Create Wrapper
    2. Create Server
    3. Create User mappings
    4. Create Nickname

    Once you have set up a nickname, for read operations, you should be able to acess the remote table in your stored procedure as a local one ...

    say, insert into localtab1 select * from remotetab1

    where remotetab1 is the nickname for a remote table ..

    I haven't had the opportunity to understand the enhancements made to V8 on the federated side ...

    For detailed information, refer to the ' information integrator ' on the V8 information centre ...

    HTH

    Sathyaram

    Originally posted by soumil
    I am new to Db2 too and ver are using UDB 8.

    I had a question about the database links.
    Lets say I have two DB2 databases A and B on the same server.
    How can I run a stored procedure from Database B which will
    pick up information from Database A and then post it back to Originating database B.

    In Oracle there is a concept of Database Links (Public and Private).
    Do we have something to the same effect.

    Any help in this issue is very well appreciated.

    Thanks
    -Soumil
    Visit the new-look IDUG Website , register to gain access to the excellent content.

  6. #6
    Join Date
    Mar 2003
    Posts
    343
    However, during the install, you will have to ensure that you install the federated option.

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Thanks cchattoraj ..

    Before creating the wrapper :


    On AIX the package is called (for V7) db2_07_01.dj ...

    You need to update dbm cfg , FEDERATED = YES


    Cheers

    Sathyaram

    Originally posted by cchattoraj
    However, during the install, you will have to ensure that you install the federated option.
    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
  •