Link to home
Create AccountLog in
Avatar of hplaud5035
hplaud5035

asked on

How can I fix error code ORA-12154 tns:could not resolve the connect identifier specified

I'm Using local naming (TNSNAMES.ORA file):

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

TNSNAMES.ORA file exists and is in the proper directory and is accessible.

The net service name used as the connect identifier exists in the TNSNAMES.ORA file.

I think there are no syntax errors anywhere in the TNSNAMES.ORA file.

TNSNAMES.ORA ENTRY
IDENTIFIER=(description=(address_list=(address=(Community=TCPCOM)(Protocol=tcp)(host=ORA01.DOMAINSUFFIX)(Port=1521)))(connect_data=(SID=MYDB_NAME)))
Avatar of DrSQL - Scott Anderson
DrSQL - Scott Anderson
Flag of United States of America image

What's your operating system?  Is the client application on the same box as the database?  Is there anyplace where you can successfully connect?  How did you determine the SID?
 
Avatar of hplaud5035
hplaud5035

ASKER

OS XP Pro, Client is not on the same box as the DATAbase.  Don't have any other DB to test config.  This is the only DB.  I'll see if I find another DB to connect somewhere else, but this is the only entry in the Tnsnames.  The sid and other settings I changed to general names for security but everything was given to the NYC office from London.  I've verified identifier, sid, community, port, host.  We can ping the host from NYC.
Can you tnsping it?  And do you have an environment variable for TNS_ADMIN? (right-click My Computer/Properties/Advanced tab/Environment Variables button/System Variables (lower) section) TNS_ADMIN should be <drive>:\<oracle home directory>\network\admin

Good luck!
It appears that I don't have tnsping utility installed.  So, no I can't tnsping it.  I didn't have an EV for TNS_ADMIN but I quickly created one and tested but it still didn't connect.  
ASKER CERTIFIED SOLUTION
Avatar of DrSQL - Scott Anderson
DrSQL - Scott Anderson
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Try to provide IP of the host in host instead of ORA01.DOMAINSUFFIX

Hope this helps
I have to go now but I will try tomorrow and post results... I think this might be it.  I was suspicious about the default domain entry in the SQLNET.ORA file because it points to a UK domain not the one we use in NYC.
I had to edit the contents of my sqlnet.ora file as follows:
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES)
the only difference is the authentication_services needed to be set to NTS and I commented out the line with the default domain entry.  Now it connects fine.  Thanks.