Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Query on database link

Re: Query on database link

From: Chuck Hamilton <chuck_hamilton_at_yahoo.com>
Date: Mon, 9 Oct 2000 06:14:52 -0700 (PDT)
Message-Id: <10644.118783@fatcity.com>


--0-1927150952-971097292=:59999
Content-Type: text/plain; charset=us-ascii  

You must have global_names turned on. That requires the db link name to match the database name that you're connecting to. Either turn off global_names, or modify the link name and global name of the remote database to be the same.   magesh <magesh_at_garoo.ne.jp> wrote:

Dear All    

 I created a database link between 2 database . When i am try to access the table "emp" of scott scheme from the second database , getting an error like this ...  

sql> select * from emp_at_orcl.kaiji1;  

Error at line 1:
 ora-02085 :database links orcl.kaiji1 connects to orcl.world.  

Why itz trying to connect to "orcl.world" instead of "orcl.kaiji1", How to resolve this problem ?  

Details of 2 databases :-  

first database(Source) ------------------------------------Second database(destination)
db_name : ora8------------------------------------------------orcl
global_name:true----------------------------------------------true
db_domain:none-----------------------------------------------kaiji1
 

Listener.ora of ORCL



SID_LIST_LISTENER =
  (SID_LIST =
(SID_DESC =
      (GLOBAL_DBNAME= ORCL.kaiji1)
      (ORACLE_HOME= /u01/app/oracle/product/8.0.5)
      (SID_NAME = ORCL)

    )  

tnsnames.ora of ORCL



ORCL.kaiji1 =
  (DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(Host= kaiji1)(Port= 1521))
(CONNECT_DATA = (SID = ORCL))

  )  

tnsnames.ora of ora8



kaiji1=
  (DESCRIPTION =
(ADDRESS = (PROTOCOL= TCP)(Host= 210.227.71.51)(Port= 1521))
(CONNECT_DATA = (SID = ORCL))

  )  

where 210.227.71.51 is Kaiji1 database  

svrmgrl >connect system/manager (connected to source database (ORA8) )  

sql > create public database link orcl.kaiji1 connect to scott identified by tiger using 'kaiji1';  

Itz created with out any error ....    

Please ..any one suggest me ..what was the error ??    

Thanx In Advance  

Bye
Magesh                



Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free! --0-1927150952-971097292=:59999
Content-Type: text/html; charset=us-ascii
<P> <BR>You must have global_names turned on. That requires the db link name to match the database name that you're connecting to. Either turn off global_names, or modify the link name and global name of the remote database to be the same.
<P>&nbsp; <B><I>magesh &lt;magesh_at_garoo.ne.jp&gt;</I></B> wrote: <BR>
<BLOCKQUOTE style="BORDER-LEFT: #1010ff 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: 5px"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><BR>
<META content="MSHTML 5.00.2919.6307" name=GENERATOR><BR>
<STYLE></STYLE>
<BR><BR>
<DIV><FONT face=Arial size=2>Dear All</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>&nbsp;I&nbsp;&nbsp;created a database link between 2 database . When i am try to access&nbsp;the table "emp"&nbsp;of scott scheme from the second database , getting</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>an error like this ...</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>sql&gt; select * from <A href="mailto:emp_at_orcl.kaiji1">emp_at_orcl.kaiji1</A>;</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Error at line 1:</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>&nbsp;ora-02085 :database links orcl.kaiji1 connects to orcl.world.</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Why itz trying to connect to "orcl.world" instead of&nbsp; "orcl.kaiji1", How to resolve this problem ?</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Details of 2 databases :-</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>first database(Source)&nbsp;------------------------------------Second database(destination)</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>db_name : ora8------------------------------------------------orcl</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>global_name:true----------------------------------------------true</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>db_domain:none-----------------------------------------------kaiji1</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Listener.ora of ORCL</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>------------------------------</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>SID_LIST_LISTENER =<BR>&nbsp; (SID_LIST =<BR>&nbsp;&nbsp;&nbsp; (SID_DESC =<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (GLOBAL_DBNAME= ORCL.kaiji1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ORACLE_HOME= /u01/app/oracle/product/8.0.5)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SID_NAME = ORCL)<BR>&nbsp;&nbsp;&nbsp; ) </FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>tnsnames.ora of ORCL</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>------------------------------------</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>ORCL.kaiji1 =<BR>&nbsp; (DESCRIPTION =<BR>&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL= TCP)(Host= kaiji1)(Port= 1521))<BR>&nbsp;&nbsp;&nbsp; (CONNECT_DATA = (SID = ORCL))<BR>&nbsp; )&nbsp;&nbsp; </FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>tnsnames.ora of&nbsp; ora8&nbsp; </FONT></DIV><BR>
<DIV><FONT face=Arial size=2>-----------------------------------</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>kaiji1=<BR>&nbsp; (DESCRIPTION =<BR>&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL= TCP)(Host= 210.227.71.51)(Port= 1521))<BR>&nbsp;&nbsp;&nbsp; (CONNECT_DATA = (SID = ORCL))<BR>&nbsp; )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>where 210.227.71.51 is Kaiji1 database</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>svrmgrl &gt;connect system/manager (connected to source database (ORA8) )</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>sql &gt; create public database link orcl.kaiji1 connect to scott identified by tiger using 'kaiji1';</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Itz created with out any error ....</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Please ..any one suggest me ..what was the error&nbsp; ??</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Thanx In Advance </FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV><FONT face=Arial size=2>Bye</FONT></DIV><BR>
<DIV><FONT face=Arial size=2>Magesh</FONT></DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV><BR>
<DIV>&nbsp;</DIV></BLOCKQUOTE><p><br><hr size=1><b>Do You Yahoo!?</b><br>
Received on Mon Oct 09 2000 - 08:14:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US