Home » SQL & PL/SQL » SQL & PL/SQL » Setting up a database link (10g, LINUX)
Setting up a database link [message #404971] Mon, 25 May 2009 21:57 Go to next message
v_zaitsev
Messages: 12
Registered: May 2009
Location: Manila
Junior Member
Hello guys I just wanna ask since a developer has been bugging me for days. He wants me to set up a database link to another oracle database and I've created it using the statement below:

CREATE DATABASE LINK <db_link name> CONNECT TO <username> IDENTIFIED BY <passwd> USING <'SID'>;

I've created it successfully and tried using the db_link with different sql statements and its working fine. However this developer told me that it is working on SQL statements like the one below:

select count(*) from all_objects@db_link;

But when he runs his application he told me that he must ran the application without the db_link parameter because if he ran it with that parameter it returns an error. Now my question is, since I'm not really a developer, is it possible to link two oracle databases without using the db_link parameter in the statements? Are there ways to directly connect from an oracle database to another oracle database and use the objects for a certain user? Please enlighten me. Thank you very much.
Re: Setting up a database link [message #404975 is a reply to message #404971] Mon, 25 May 2009 22:54 Go to previous messageGo to next message
BlackSwan
Messages: 25037
Registered: January 2009
Location: SoCal
Senior Member
http://www.dbforums.com/oracle/1643003-setting-up-database-link.html
Re: Setting up a database link [message #405048 is a reply to message #404975] Tue, 26 May 2009 03:25 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
That's a change - instead of an unhelpful post, we now have a link to an unhelpful post in another forum.

It is possible to avoid using the '@db-link' syntax in the application code - create the database link as normal, and then create synonyms in the local database for all of the objects in the remote database that you want to use.

This will let the application code refer to the synonyms, and the inconvenient @ syntax can be avoided.
Previous Topic: lpad
Next Topic: select the last value from FETCH statement
Goto Forum:
  


Current Time: Mon Dec 05 06:45:56 CST 2016

Total time taken to generate the page: 0.22400 seconds