DB Link error : ORA-12154: TNS:could not resolve the connect identifier....
BaffyDec 21 2010 — edited Nov 15 2011All,
Please help. I'm getting the above error despite doing everything I know to do:
tnsnames.ora entry for remote database (this is what's on the local database):
ORACLE6.STAGING =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle6.staging.hobank.net)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = banksys))
)
The following works without problems from local database to remote database:
On local database:
sqlplus kay/kay@oracle6.staging
...
...
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
2 Kay Baffy DBA 1 06-NOV-10 50000 .25
2
**This data is correct and comes from the remote database***
then I created the database link while logged into the local database:
create public database link oracle6.staging
connect to kay identified by kay
using 'oracle6.staging';
Database link created.
!!!But the following doesn't work:
SQL> select * from emp@oracle6.staging;
select * from emp@oracle6.staging
*
ERROR at line 1:
ORA-12154: TNS:could not resolve the connect identifier specified
I'm certain about the following:
1. DB link was created on local database.
2. oracle6.staging entry is in tnsnames.ora
3. I'm able to connect to remote database with : sqlplus kay/kay@oracle6.staging
**Any help will be appreciated.***
Thanks in advance.
Baffy