DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Simple question on DB LINKS

  1. #1
    Join Date
    Oct 2002
    Posts
    284

    Simple question on DB LINKS

    Hello Gurus..

    I created a db link like this.
    create public database link my_link connect to home_office identified by home using 'j2ee';

    Link is created successfully. and i was able to connect to the database. Now when i remove my tnsnames entry for that DB on my work station, the Link doesn't work.

    So my question is
    1) do we need to have tnsnames entry to the database for which i created the link ?. is so, then what is the point in creating a link, i can as well type
    home_office/home@j2ee.

    i just dont understand this thing. can anyone shed some light on where iam getting it wrong. really appreciate it.

    Thanks

  2. #2
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Not unless the host database is on your machine.

    Only the machine hosting the database with a db_link needs connection information to the target database.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  3. #3
    Join Date
    Nov 2002
    Posts
    170
    What Ken said is right.

    If you don't want to use tnsnames.ora file then you can create the dblink as follows

    Create public database link my_link
    connect to 'paste the entire tnsnames entry here in quotes'
    using 'j2ee';

    This will not use the tnsnames.ora file.

  4. #4
    Join Date
    Apr 2001
    Location
    Louisville KY
    Posts
    295

    Red face

    DB Links enable one database to get/process data on another database. They are not intended to replace database connections.

    You would use them such as Select * from emp@home
    simplifying sharing information.
    Joseph R.P. Maloney, CSP,CDP,CCP
    'The answer is 42'

  5. #5
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    I completely agree with Joseph.

    A database link is a great way to combine data from different hardware and memory structures that wouldn't normally live together. A single database connection can bring back data from a number of databases, even a SQL Server database (via a gateway).

    Joins across a db_link will not perform well if the joining tables have many rows so I use them sparingly. And then there's the overhead of making the connection to consider also.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

Posting Permissions

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


Click Here to Expand Forum to Full Width