Home » Other » Client Tools » Could not resolve service name (Oracle 11g R2, TNS for 64-bit Windows: Version 11.2.0.2.0 - Production)
Could not resolve service name [message #644685] Fri, 13 November 2015 02:11 Go to next message
mokarem
Messages: 109
Registered: November 2013
Location: Dhaka
Senior Member

Hi All,

I can connect from client machine using SQLPLUS as below:


SQL> conn user/pass@dbservername:1522/orcl
Connected.
SQL>


But If I config tnsname.ora file as below

TEST=
  (DESCRIPTION=
    (ADDRESS=
      (PROTOCOL=TCP)
      (HOST=dbservername)
      (PORT=1522)
    )
    (CONNECT_DATA=
      (SID = orcl)
    )
  )


I can't connect from PL/SQL Developer using this 'TEST' tnsname.
I get error: ORA-12154: TNS: could not resolve service name.

What could be the solution for this?

Regards
Mokarem
Re: Could not resolve service name [message #644687 is a reply to message #644685] Fri, 13 November 2015 02:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

1/ Make sure PL/SQL Developer use the tnsnames.ora you think it uses
2/ See sqlnet.ora: names.default_domain

The first test is to use the same connect string in SQL*Plus to see if it works.
But I bet PL/SQL Developer does not use the same Oracle Home and so tnsnames.ora.

[Updated on: Fri, 13 November 2015 02:26]

Report message to a moderator

Re: Could not resolve service name [message #644688 is a reply to message #644687] Fri, 13 November 2015 02:41 Go to previous messageGo to next message
mokarem
Messages: 109
Registered: November 2013
Location: Dhaka
Senior Member


Thanks

My PL/SQL developer is using different tnsname.ora file. Now I can connect from my PL/SQL Developer.

And the content of the sqlnet file is

SQLNET.AUTHENTICATION_SERVICES= (NONE)

NAMES.DIRECTORY_PATH= (TNSNAMES)


If the sqlnet file contains names.default_domain, What would be the solution?

Regards
Mokarem
Re: Could not resolve service name [message #644689 is a reply to message #644688] Fri, 13 November 2015 02:45 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
mokarem wrote on Fri, 13 November 2015 14:11

My PL/SQL developer is using different tnsname.ora file. Now I can connect from my PL/SQL Developer.


You could have tested and confirmed the tns string with SQL*Plus itself. Then made sure PL/SQL Developer also uses the same tns string.
Re: Could not resolve service name [message #644690 is a reply to message #644688] Fri, 13 November 2015 03:04 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
mokarem wrote on Fri, 13 November 2015 08:41

Thanks

<snip>
If the sqlnet file contains names.default_domain, What would be the solution?

Regards
Mokarem

Look it up. I'll give you the link to the doc, but I'm not searching the index for you.
http://docs.oracle.com/database/121/NETRF/toc.htm
Re: Could not resolve service name [message #644691 is a reply to message #644689] Fri, 13 November 2015 03:06 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Lalit Kumar B wrote on Fri, 13 November 2015 09:45
mokarem wrote on Fri, 13 November 2015 14:11

My PL/SQL developer is using different tnsname.ora file. Now I can connect from my PL/SQL Developer.


You could have tested and confirmed the tns string with SQL*Plus itself. Then made sure PL/SQL Developer also uses the same tns string.


... and tnsnames.ora setting TNS_ADMIN environment variable.

Previous Topic: User and Password error (merged 3)
Next Topic: [SQL*Plus] SET SECUREDCOL
Goto Forum:
  


Current Time: Thu Mar 28 05:10:50 CDT 2024