Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more: (untagged)
CSS
The following Error Occured while Connecting to Database.
"ORA-12154 :TNS:Could not resolve the connect identifier specified".
Plz Give Me Solution to solve this error.
Posted
Updated 7-Mar-17 4:54am

Ever heard of google?

http://ora-12154.ora-code.com/[^]
 
Share this answer
 
This is an Oracle error rather than a .NET error. Check your TNSNames.ora file.
 
Share this answer
 
The connect identifier which you are using is not available in your tnsnames.ora file. You need to edit this file and add proper details.
 
Share this answer
 
SYMPTOM
Receive the error message, "ORA-12154 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.

RESOLUTION
If you are using local naming (TNSNAMES.ORA file)

1. Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)

2. Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.

3. Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.

4. 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

1. Verify that "LDAP" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

2. Verify that the LDAP directory server is up and that it is accessible.

3. Verify that the net service name or database name used as the connect identifier is configured in the directory.

4. 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

1. Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

2. Make sure the host, port, and service name specified are correct.

3. Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.
 
Share this answer
 
Comments
fjdiewornncalwe 24-Jan-12 9:42am    
This question is almost 2 years old. Please don't reopen old questions like this by answering them now.
[no name] 18-Sep-13 12:37pm    
Dear Marcus,
why not, if some one recently joins and he/she knows the answer then why you having problem in this. Rather, it's good to see somebody have an answer.
[no name] 18-Sep-13 13:17pm    
Someone already did have an answer.... 3 years ago.... There is no real reason to keep answering questions over and over that provide no real value.
ora-12154 tns could not resolve the connect identifier

if you are still facing this error please go through this !!!!

same error we will get if we don't follow the oracle password policies

check the below link for password setup rules for oracle https://docs.oracle.com/cd/B28359_01/network.111/b28531/guidelines.htm#CHDEGEIF

I also had this issue, and the root cause was, my password has '@' character. I just enclosed the password in double quotes and it worked. e.g. connect system/"p@sswor
 
Share this answer
 
Comments
CHill60 8-Mar-17 17:50pm    
"if you are still facing this error" ... seven years later - probably not!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900