Unable to resolve tns names

Hi

I am using Win 7 with Toad 12.1

Previously I used Toad 9.1 on win XP

Using Ora92 client.

However when I connect to Oracle11 DB, I get the following error

Error

ORA-12154: TNS:could not resolve service name

Items Checked

[Pass] TNS_ADMIN environment variable is defined as "C:\Oracle\config"

[Pass] "C:\Oracle\config\tnsnames.ora" was located

[Pass] The following connect descriptor was found for TRIADP in the tnsnames.ora file



TriadP = (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=se394)(PORT=1521))(CONNECT_DATA=(SID=TriadP)))

[Pass] "C:\Oracle\config\sqlnet.ora" was located

[Pass] NAMES.DIRECTORY_PATH specifies TNSNAMES in the sqlnet.ora file

When I test ping the DB connection on tnsserver, it is success.

sqlnet.ora file attached

Could you please help to identify what is wrong with my setting to connect.

thanks
sqlnet.ora (652 Bytes)

Also should add that tnsping from cmd on the database is success.

Another issue is that the location of the Quest Software was at

C:\Program Files (x86)\Quest Software\Toad for Oracle 12.1

You might try installing toad into a directory that does not contain a parenthesis - as there were Oracle client issues with parenthesis in name. If you search the toad support web site you’ll find references to this known Oracle client issue. I copied one such support doc below - note solution #5:

Toad for Oracle Knowledge Article 35757

Title Error attempting to connect to database via Toad "ORA-12154 TNS: Could not resolve the connect id

Description

ORA-12154 TNS: Could not resolve the connect identifier specified error upon attempting to connect to database via Toad.

Cause

Check for usual issues with 64bit.

If not, then may be an issue with tns and sqlnet setup.

Resolution

RESOLUTION 1:

If Oracle client installed is a 64-bit client.Toad will not show this client under Installed Clients of the Login window. Oracle client needs to be uninstalled and a 32-bit client needs to be installed on machine. Attached is documentation on how to completely remove the existing client. We cannot guarantee the contents of this documentation, and it is for users information only.

To download a free version of Oracle client, refer to www.oracle.com/…/index.html.

RESOLUTION 2:

If the 32-bit client was recently upgraded. Perform the following:

  1. Right-click on MY COMPUTER and select Properties

  2. Select Advanced Tab and Environment Variables button

  3. Under System Variables, if an ORA_HOME entry exits ensure the BIN folder of the Oracle client exists for this entry

  4. Hit Edit button to modify or add this path

RESOLUTION 3:

  1. Right-Click My Computer | Properties | Advanced tab | Environment Variables button | under System Variables section | click New button.

  2. Type: TNS_ADMIN for Variable Name.

  3. Type:

  4. Click OK, OK, and OK

  5. Start Toad and re-test issue

RESOLUTION 4:

Check the sqlnet.ora file. If there is “NAMES.DEFAULT_DOMAIN = <>”, please make sure the domain specified is included in you database entries in the tnsnames.ora file. Or you can remove this line from the sqlnet.ora file so there is not domain requirement.

Sample:

In SQLNet.ora:

NAMES.DEFAULT_DOMAIN = PROD.QUEST

In TNSNames.ora:

TEST.PROD.QUEST=

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = TEST206115)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = test.prod.quest)

)

)

,

RESOLUTION 5:

If Toad is installed in the Program Files (X86), then copy the Quest Software folder from Program Files (X86) to the Program Files folder and create a short cut to the Toad.exe file from this directory.

RESOLUTION 6:

Ensure you have a “tnsnames.ora” file and it contains correct and accurate TNS entry for the database you want to connect to. Please consult with your Oracle DBA or IT Department on this regard. They may provide you with a “tnsnames.ora” file you can use.

Hi,

I am also getting the same error:

ORA-12154: TNS:could not resolve the connect identifier specified

Items Checked

TNS_ADMIN environment variable is defined as “C:\oracle\Tnsadmin” --> Pass

“C:\oracle\Tnsadmin\tnsnames.ora” was located --> Pass

The following connect descriptor was found for ICCTST.CANALDIGITAL.COM in the tnsnames.ora file --> Pass

ICCTST.canaldigital.com=

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ora-stg-1-scan.canaldigital.com)(PORT = 1521))

(CONNECT_DATA =

  (SERVER = DEDICATED)

  (SERVICE_NAME = ICCTST.canaldigital.com)

)

)

“C:\oracle\Tnsadmin\sqlnet.ora” was located --> Pass

NAMES.DIRECTORY_PATH specifies TNSNAMES in the sqlnet.ora file --> Pass

I am running the Oracle 11.2.0.4 Database, Windows 7 64 bit OS, Oracle Client 64 bit 11.2.0.4.

From your original post it appears that you are running Toad 32 bit. From your latest info, you are running a 64 bit Oracle client. You either need a 32 bit client or 64 bit Toad.

Greg

On Sep 29, 2014, at 10:06 PM, azmat.zaheer bounce-azmatzaheer@toadworld.com wrote:

RE: Unable to resolve tns names

Reply by azmat.zaheer
Hi,

I am also getting the same error:

ORA-12154: TNS:could not resolve the connect identifier specified

Items Checked

TNS_ADMIN environment variable is defined as "C:\oracle\Tnsadmin" --> Pass

"C:\oracle\Tnsadmin\tnsnames.ora" was located --> Pass

The following connect descriptor was found for
ICCTST.CANALDIGITAL.COM
in the tnsnames.ora file --> Pass

ICCTST.canaldigital.com=

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST =
ora-stg-1-scan.canaldigital.com
)(PORT = 1521))

(CONNECT_DATA =

 (SERVER = DEDICATED)
 (SERVICE_NAME = [

ICCTST.canaldigital.com](http://ICCTST.canaldigital.com))

)

)

"C:\oracle\Tnsadmin\sqlnet.ora" was located --> Pass

NAMES.DIRECTORY_PATH specifies TNSNAMES in the sqlnet.ora file --> Pass

I am running the Oracle 11.2.0.4 Database, Windows 7 64 bit OS, Oracle Client 64 bit 11.2.0.4.

To reply, please reply-all to this email.

Stop receiving emails on this subject.

Or
Unsubscribe from Toad for Oracle - General
notifications altogether.

Toad for Oracle - Discussion Forum

Flag
this post as spam/abuse.

Greg:

If your answer is related to my issue…then the answer is NO i am running toad 64 bit.

Hmmm

Please share your tnsnames.ora file content.

what to do you get as respond when you start command prompt (Start|Run|cmd) and then place in it statements:
tnsping ICCTST.canaldigital.com
tnsping ICCTST

please recheck initial respond, where you can see which file is used by default. Please show us all.

please take a look at: http://www.dbasupport.com/forums/showthread.php?46301-ORA-12514-TNS-listener-could-not-resolve-SERVICE_NAME-given-in-connect-descriptor

Brg

Damir