Issue in Database Link [message #606183] |
Mon, 20 January 2014 23:55 |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi All,
I'm facing an issue while using a DB Link.
I've two oracle databases. DB1 and DB2. I'm following the same procedure to create database link on DB1 for DB2 and on DB2 for DB1. One of them is working perfectly fine by another one is not.
--On DB1
CREATE DATABASE LINK DBLNK_DB2
CONNECT TO myuser
IDENTIFIED BY myuser
USING '10.10.1.250:1521/DB2' ;
SELECT * FROM myuser.mytable@DBLNK_DB2 ;
--above query is giving below error.
ORA-12154: TNS:could not resolve the connect identifier specified
12154. 00000 - "TNS:could not resolve the connect identifier specified"
*Cause: A connection to a database or other service was requested using
a connect identifier, and the connect identifier specified could not
be resolved into a connect descriptor using one of the naming methods
configured. For example, if the type of connect identifier used was a
net service name then the net service name could not be found in a
naming method repository, or the repository could not be
located or reached.
*Action:
- If you are using local naming (TNSNAMES.ORA file):
- Make sure that "TNSNAMES" is listed as one of the values of the
NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
(SQLNET.ORA)
- Verify that a TNSNAMES.ORA file exists and is in the proper
directory and is accessible.
- Check that the net service name used as the connect identifier
exists in the TNSNAMES.ORA file.
- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
file. Look for unmatched parentheses or stray characters. Errors
in a TNSNAMES.ORA file may make it unusable.
- If you are using directory naming:
- Verify that "LDAP" is listed as one of the values of the
NAMES.DIRETORY_PATH parameter in the Oracle Net profile
(SQLNET.ORA).
- Verify that the LDAP directory server is up and that it is
accessible.
- Verify that the net service name or database name used as the
connect identifier is configured in the directory.
- Verify that the default context being used is correct by
specifying a fully qualified net service name or a full LDAP DN
as the connect identifier
- If you are using easy connect naming:
- Verify that "EZCONNECT" is listed as one of the values of the
NAMES.DIRETORY_PATH parameter in the Oracle Net profile
(SQLNET.ORA).
- Make sure the host, port and service name specified
are correct.
- Try enclosing the connect identifier in quote marks.
Error at Line: 13 Column: 33
If I follow the same procedure on DB2 to create DB link for DB1 it's working perfectly fine.
Please help me to resolve this issue.
Thanks & Regards
Manoj
|
|
|
|
|
Re: Issue in Database Link [message #606189 is a reply to message #606186] |
Tue, 21 January 2014 00:45 |
Manoj.Gupta.91
Messages: 239 Registered: March 2008 Location: Delhi
|
Senior Member |
|
|
Hi All,
Thanks for your help and support.
It worked when I did these steps.
--TNS entry on DB1.
DB2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.1.250)(PORT = 1521))
)
(CONNECT_DATA =
(SID = DB2)
)
)
--DB Link on DB1.
CREATE DATABASE LINK DBLNK_DB2
CONNECT TO myuser
IDENTIFIED BY myuser
USING 'DB2' ;
When I tried to create db link as below. There was still an issue.
CREATE DATABASE LINK DBLNK_DB2
CONNECT TO myuser
IDENTIFIED BY myuser
USING '10.10.1.250:1521/DB2' ;
I want to know what is the difference in creating DB link using these two approaches?
Why first approach worked but second approach still throws an error?
Please help me find answers to these questions coming in my mind.
Thanks & Regards
Manoj
|
|
|
|