Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Query on database link
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) ------------------------------------Seconddatabase(destination)
db_name : ora8------------------------------------------------orcl global_name:true----------------------------------------------true db_domain:none-----------------------------------------------kaiji1
Listener.ora of ORCL
(GLOBAL_DBNAME= ORCL.kaiji1) (ORACLE_HOME= /u01/app/oracle/product/8.0.5) (SID_NAME = ORCL)
tnsnames.ora of ORCL
tnsnames.ora of ora8
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> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2> I created a database =link between=20
<DIV><FONT face=3DArial size=3D2>an error like this ...</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>sql> select * from <A=20href=3D"mailto:emp_at_orcl.kaiji1">emp_at_orcl.kaiji1</A>;</FONT></DIV>
<DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Error at line 1:</FONT></DIV> <DIV><FONT face=3DArial size=3D2> ora-02085 :database links =orcl.kaiji1=20
<DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Details of 2 databases :-</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>first=20 database(Source) ------------------------------------Second=20database(destination)</FONT></DIV>
ora8------------------------------------------------orcl</FONT></DIV><DIV><FONT face=3DArial=20
size=3D2>global_name:true----------------------------------------------tr=ue</FONT></DIV>
size=3D2>db_domain:none-----------------------------------------------kai=ji1</FONT></DIV>
<DIV> </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> = (SID_LIST=20
<DIV> </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> (DESCRIPTION=20 =3D<BR> (ADDRESS =3D (PROTOCOL=3D TCP)(Host=3D = kaiji1)(Port=3D=20
) </FONT></DIV>
<DIV> </DIV> <DIV><FONT face=3DArial size=3D2>tnsnames.ora of ora8 = </FONT></DIV> <DIV><FONT face=3DArial = size=3D2>-----------------------------------</FONT></DIV><DIV><FONT face=3DArial size=3D2>kaiji1=3D<BR> (DESCRIPTION=20 =3D<BR> (ADDRESS =3D (PROTOCOL=3D TCP)(Host=3D = 210.227.71.51)(Port=3D=20
) </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>where 210.227.71.51 is Kaiji1 =
database</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>svrmgrl >connect system/manager =
(connected to=20
source database (ORA8) )</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>sql > create public database link =
orcl.kaiji1=20
connect to scott identified by tiger using 'kaiji1';</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Itz created with out any error =
....</FONT></DIV> <DIV> </DIV> <DIV> </DIV>
error ??</FONT></DIV> <DIV> </DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>Thanx In Advance </FONT></DIV> <DIV> </DIV>