cannot connect using oracle net_service [message #142866] |
Tue, 18 October 2005 01:37 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
hi,
I have a Solaris 9 box hosting Oracle 9i . I created a tnsnames.ora file manually.
Now the problem is that when i can connect to oracle without specifying net_service name but when i try to connect with the net_service name it generates error -- ORA-12154: TNS:could not resolve service name.
Quote: |
dogmatix:SID=testdb=>sqlplus scott/tiger@srvc_testdb
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Oct 18 02:25:23 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve service name
Enter user-name: scott/tiger
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL>
|
But the service name exist in the tnsnames.ora file
tnsnames.ora file
SRVC_TESTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dogmatix)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = testdb)
)
)
sqlnet.ora file
# SQLNET.ORA Network Configuration File: /data1/u01/app/oracle/product/9.2.0/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES=(NONE)
NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)
and now see when i use tnsping
Quote: |
dogmatix:SID=testdb=>tnsping srvc_testdb
TNS Ping Utility for Solaris: Version 9.2.0.1.0 - Production on 18-OCT-2005 02:35:38
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/data1/u01/app/oracle/product/9.2.0/network/admin/sqlnet.ora
TNS-03505: Failed to resolve name
[ /data1/u01/app/oracle/product/9.2.0/network/admin ]
dogmatix:SID=testdb=>
|
but when i try by specifying address
Quote: |
ogmatix:SID=testdb=>tnsping '(ADDRESS=(PROTOCOL=tcp)(HOST=dogmatix)(PORT=1521))'
TNS Ping Utility for Solaris: Version 9.2.0.1.0 - Production on 18-OCT-2005 02:36:52
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Attempting to contact (ADDRESS=(PROTOCOL=tcp)(HOST=dogmatix)(PORT=1521))
OK (10 msec)
|
Note : I am trying to connect from the same machine which is hosting Oracle so no network connectivity issue i suppose.
regards & thanks,
tarun
|
|
|
Re: cannot connect using oracle net_service [message #142893 is a reply to message #142866] |
Tue, 18 October 2005 04:57 |
Frank Naude
Messages: 4581 Registered: April 1998
|
Senior Member |
|
|
Hi,
03505, 00000, "Failed to resolve name"
// *Cause: The service name you provided could not be found in TNSNAMES.ORA,
// an Oracle Names server, or a native naming service.
// *Action: Verify that you entered the service name correctly. You may need
// to ensure that the name was entered correctly into the network
// configuration.
Try adding this to your SQLNET.ORA file: NAMES.DEFAULT_DOMAIN = world
... and change your TNSNAMES.ORA entry to:
Best regards.
Frank
|
|
|
Re: cannot connect using oracle net_service [message #142896 is a reply to message #142893] |
Tue, 18 October 2005 05:13 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
Frank, Thanks for the reply but the problem still persist.
I changed as u mentioned ,
sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES=(NONE)
NAMES.DEFAULT_DOMAIN=world
NAMES.DIRECTORY_PATH=(TNSNAMES, ONAMES, HOSTNAME)
tnsnames.ora
SRVC_TESTDB.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dogmatix)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = testdb)
)
)
and now see this
Quote: |
testdb=>sqlplus "sys/tarun as sysdba"
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Oct 18 06:06:31 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> exit
Disconnected
|
but not with net_service
Quote: |
testdb=>sqlplus "sys/tarun@srvc_testdb.world as sysdba"
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Oct 18 06:07:03 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve service name
Enter user-name:
|
Quote: |
testdb=>tnsping srvc_testdb.world
TNS Ping Utility for Solaris: Version 9.2.0.1.0 - Production on 18-OCT-2005 06:05:52
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
/data1/u01/app/oracle/product/9.2.0/network/admin/sqlnet.ora
TNS-03505: Failed to resolve name
|
any other idea .
[Updated on: Tue, 18 October 2005 05:13] Report message to a moderator
|
|
|
|
|
|
Re: cannot connect using oracle net_service [message #142920 is a reply to message #142907] |
Tue, 18 October 2005 07:31 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
Hi Frank,
First of all thanks for your support . And now i am able to resolve the issue. I am explaining the problem .
The parameter TNS_ADMIN was set on my machine and it was pointing to a non-default location. And i was creating the tnsnames.ora file at the default location i.e. $ORACLE_HOME/network/admin but Oracle was reading from the location specified by TNS_ADMIN environment variable .
I removed it and now everything working fine.
Thanks for your help.
tarun
|
|
|
|
|
|
|
|