Home » RDBMS Server » Networking and Gateways » ORA-12154: TNS:could not resolve service name
ORA-12154: TNS:could not resolve service name [message #67037] Fri, 20 June 2003 03:26 Go to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Right then,

I have Oracle client and a version of Oracle Personal Edition running on my Win2k system. The tnsnames.ora and sqlnet.ora files are the same (except for the header line e.g. # TNSNAMES.ORA Network ...

I can tnsping the personal edition instance fine but when I attempt to tnsping the db for which the client is installed I get a TNS-03505: Failed to resolve name. error. The connection data for this remote database appears to be ok in tnsnames.ora. I get the ORA-12154 error when attempting to connect to the remote instance via a SQL client e.g. TOAD.

My tnsnames.ora file is: CTSTEST is remote instance, MyORA817 is personal edition

# TNSNAMES.ORA Network Configuration File: C:OraHome1networkADMINtnsnames.ora
# Generated by Oracle configuration tools.

CTSTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DEVDC1)(PORT = 1521))
)
(CONNECT_DATA =
(SID = CTSTEST)
)
)

MYORA817 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ni-cr-cts-3945a)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = MyORA817)
)
)

Weird bit is though, when I got to Net8 Config Assistant, I can test the connection to the remote database fine and cannot connect to the personal edition instance i.e the opposite if what's happening with tnsping. I think the error could have something to do with the CONNECT_DATA string i.e remote uses SID= while personal uses SERVICE_NAME=

In the registry I have two homes i.e. HOME0 and HOME1 which point to the relevant directories.

Anybody know what could be happening ?
Re: ORA-12154: TNS:could not resolve service name [message #67038 is a reply to message #67037] Fri, 20 June 2003 06:07 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Make sure u use the right sql*plus and tnsnames.ora
Becuse the each client/server sqlplusw.exe uses its own tnsnames.ora.
if ther are multiple homes, there are multiple copies of these.
edit your sqlnet.ora and comment of all the entries.

depending on the version of server/client u use , 
SID and SERVICE_NAME is flipped.
for oracle 8 you have use  SID 
for 8i, you have to SERVICE_NAME
for 9i RAC it workwith SERVICE_NAME.
for 9i single instance..its fleaky ( sometimes it work s with SID and sometimes with SERVICE_NAME...and i always think to explore this...never go a chance..)

Re: ORA-12154: TNS:could not resolve service name [message #67039 is a reply to message #67038] Mon, 23 June 2003 02:16 Go to previous messageGo to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
No joy I'm afraid.

Added the registry value to both HOME keys so that only one version of tnsnames.ora is used. Also changed format from SID=.... to SERVICE_NAME=... as suggested. Still the same problem.

Is there anything else I can try ?
Re: ORA-12154: TNS:could not resolve service name [message #67079 is a reply to message #67037] Thu, 28 August 2003 03:56 Go to previous messageGo to next message
Mark
Messages: 284
Registered: July 1998
Senior Member
verify sqlnet.ora file not contain entrie about domain.
test in one enviroment (oracle_home) the connections by tnsping and sqlplus prompt (try to switch each other only the name of connect descriptor).

Mark
Re: ORA-12154: TNS:could not resolve service name [message #67320 is a reply to message #67039] Wed, 28 April 2004 10:15 Go to previous message
vincent
Messages: 18
Registered: November 1998
Junior Member
make sure your sqlnet.ora contains this line

"NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES)"
Previous Topic: database link is not active
Next Topic: Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC driver for Oracl
Goto Forum:
  


Current Time: Thu May 02 13:08:32 CDT 2024