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

Home -> Community -> Usenet -> c.d.o.misc -> Re: ORA-12505

Re: ORA-12505

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Thu, 01 Mar 2007 20:11:07 +0100
Message-ID: <es7dhb$ifi$1@news4.zwoll1.ov.home.nl>


it's hot here schreef:
> Hi,
>
> I am trying to create and use a database link to database A. I create it
> like this:
>
> CREATE PUBLIC DATABASE LINK dev_link
> CONNECT TO <user>
> IDENTIFIED BY <pass>
> USING '<SID>';

Not quite - it's: using 'tns_alias'
>
> where the items in <> are replaced by the actual values. This part is
> OK.
>
> When I try and use dev_link in database B, I get an ORA-12505:
>
> SELECT *
> FROM TABLE_at_DEV_LINK
> *
> ERROR at line 14:
> ORA-06550: line 14, column 10:
> PL/SQL: ORA-04052: error occurred when looking up remote object
> <user>.TABLE_at_DEV_LINK
> ORA-00604: error occurred at recursive SQL level 1
> ORA-12505: TNS:listener could not resolve SID given in connect
> descriptor
> ORA-06550: line 13, column 5:
> PL/SQL: SQL Statement ignored
>
> I've searched for some help to this problem and found not a lot that I
> can understand: this happens because database B does not know about
> database A? If that's the case, how can I make B aware of A? I would
> like to do this with a script, that is, not in a GUI setting. I want
> this to run every day (since database B is refreshed every night)
>
> Thanks,
> Andrew
>
>

As the dblink uses an tns_alias, you will have to configure sql*net. The tns_alias used to create the dblink must be defined in the TNS_ADMIN directory of server B (and not on your client! B is behaving as a client to A).
The TNS_ADMIN directory is ORACLE_HOME/network/admin by default. You want to update the tnsnames.ora file (unless you use other mechanisms to resolve tns names, of course)

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Thu Mar 01 2007 - 13:11:07 CST

Original text of this message

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