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

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

Query on database link

From: magesh <magesh_at_garoo.ne.jp>
Date: Mon, 9 Oct 2000 14:07:21 +0900
Message-Id: <10643.118748@fatcity.com>


This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C031FA.3DCFFDC0 Content-Type: text/plain;

        charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit

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

------=_NextPart_000_000E_01C031FA.3DCFFDC0 Content-Type: text/html;

        charset="iso-2022-jp"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-2022-jp" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Dear All</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;I&nbsp;&nbsp;created a database =
link between=20
2 database . When i am try to access&nbsp;the table "emp"&nbsp;of scott = scheme =20
from the second database , getting</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>an error like this ...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>sql&gt; select * from <A=20
href=3D"mailto:emp_at_orcl.kaiji1">emp_at_orcl.kaiji1</A>;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Error at line 1:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;ora-02085 :database links =
orcl.kaiji1=20
connects to orcl.world.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Why itz trying to connect to = "orcl.world" instead=20
of&nbsp; "orcl.kaiji1", How to resolve this problem ?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Details of 2 databases :-</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>first=20
database(Source)&nbsp;------------------------------------Second=20
database(destination)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>db_name :=20
ora8------------------------------------------------orcl</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>global_name:true----------------------------------------------tr=
ue</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>db_domain:none-----------------------------------------------kai=
ji1</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Listener.ora of ORCL</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>SID_LIST_LISTENER =3D<BR>&nbsp; = (SID_LIST=20
=3D<BR>&nbsp;&nbsp;&nbsp; (SID_DESC =
=3D<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 (GLOBAL_DBNAME=3D ORCL.kaiji1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (ORACLE_HOME=3D=20
/u01/app/oracle/product/8.0.5)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (SID_NAME =3D=20
ORCL)<BR>&nbsp;&nbsp;&nbsp; ) </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>tnsnames.ora of ORCL</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>------------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ORCL.kaiji1 =3D<BR>&nbsp; (DESCRIPTION=20 =3D<BR>&nbsp;&nbsp;&nbsp; (ADDRESS =3D (PROTOCOL=3D TCP)(Host=3D = kaiji1)(Port=3D=20
1521))<BR>&nbsp;&nbsp;&nbsp; (CONNECT_DATA =3D (SID =3D ORCL))<BR>&nbsp; =

)&nbsp;&nbsp; </FONT></DIV>

<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>tnsnames.ora of&nbsp; ora8&nbsp; =
</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>-----------------------------------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>kaiji1=3D<BR>&nbsp; (DESCRIPTION=20 =3D<BR>&nbsp;&nbsp;&nbsp; (ADDRESS =3D (PROTOCOL=3D TCP)(Host=3D = 210.227.71.51)(Port=3D=20
1521))<BR>&nbsp;&nbsp;&nbsp; (CONNECT_DATA =3D (SID =3D ORCL))<BR>&nbsp; =

)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></DIV> <DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>where 210.227.71.51 is Kaiji1 = database</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>svrmgrl &gt;connect system/manager = (connected to=20
source database (ORA8) )</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>sql &gt; create public database link = orcl.kaiji1=20
connect to scott identified by tiger using 'kaiji1';</FONT></DIV> <DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Itz created with out any error =

....</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>

<DIV><FONT face=3DArial size=3D2>Please ..any one suggest me ..what was = the=20
error&nbsp; ??</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanx In Advance </FONT></DIV>
<DIV>&nbsp;</DIV>

<DIV><FONT face=3DArial size=3D2>Bye</FONT></DIV> <DIV><FONT face=3DArial size=3D2>Magesh</FONT></DIV> Received on Mon Oct 09 2000 - 00:07:21 CDT

Original text of this message

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