ODP.NET unable to connect [message #543503] |
Wed, 15 February 2012 01:32  |
 |
gustav
Messages: 6 Registered: February 2012
|
Junior Member |
|
|
I am trying to connect to an 11gR2 DB from a Windows Server 2008 R2 64 bit client with a 64bit client application. The 64bit client is the only one installed in the machine and ORACLE_HOME and TNS_ADMIN points to the correct paths. I use ODP.net4 so I installed it to use the oracle home as the client.
I am able to connect to the server with SQLPlus, using TNS (afis/***@AFISL), but when I attempt to connect with the client application, I get this error:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
The connection string I use is: "Data Source=AFISL;user id=afis;password=***;"
Listener.ora:
# listener.ora Network Configuration File: G:\app\Administrator\product\11.2.0\dbhome_2\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.22.18)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = AFISETX)
(ORACLE_HOME = G:\app\Administrator\product\11.2.0\dbhome_2)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:G:\app\Administrator\product\11.2.0\dbhome_2\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = AFISL)
(GLOBAL_DBNAME = AFISl.PenCom.Local)
(ORACLE_HOME = G:\app\Administrator\product\11.2.0\dbhome_2)
)
)
ADR_BASE_LISTENER1 = G:\app\Administrator
# sqlnet.ora Network Configuration File: C:\app\Administrator\product\11.2.0\client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, ONAMES, HOSTNAME)
NAMES.DEFAULT_DOMAIN= PenCom.Local
# tnsnames.ora Network Configuration File: c:\app\Administrator\product\11.2.0\client_1\\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
AFISL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.22.18)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = AFISL.PenCom.Local)
)
)
|
|
|
|
|
Re: ODP.NET unable to connect [message #543519 is a reply to message #543513] |
Wed, 15 February 2012 02:07   |
John Watson
Messages: 8965 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Gustav, there is inconsistency in your Oracle Net files. In listener.ora, you create a listener called LISTENER1, but then you define SID_LIST for a listener called LISTENER. This is possibly why you get the ora-12514.
|
|
|
Re: ODP.NET unable to connect [message #543521 is a reply to message #543519] |
Wed, 15 February 2012 02:16   |
John Watson
Messages: 8965 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Another inconsistency: you have defined a default_domain in sqlnet.ora, but you have not appended this to the TNS name defined in tnsnames.ora. Personally, I do not use default_domain because I think it causes confusion for no benefit. I would get rid of it.
|
|
|
|
Re: ODP.NET unable to connect [message #543527 is a reply to message #543524] |
Wed, 15 February 2012 02:29   |
John Watson
Messages: 8965 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Quote: I can connect with SQLplus In that case, you are not using those files. The inconsistency with the default_domain makes it impossible.
Quote:Data Source=afis/***@//10.1.22.18/afisl.pencom.local
There is no port specified here. Does ODP.net4 have a default for this? It would need to be :1521.
[edit: sorry, I missed that you had removed thhe default domain. So OK, SQL*Plus should work with those files now]
[Updated on: Wed, 15 February 2012 02:30] Report message to a moderator
|
|
|
|
|
|
|
Re: ODP.NET unable to connect [message #543541 is a reply to message #543534] |
Wed, 15 February 2012 03:08   |
 |
gustav
Messages: 6 Registered: February 2012
|
Junior Member |
|
|
I renamed the listener from listener1 to listener to remove the inconsistency mentioned in the listeners.ora file
Output:
**********************************************************************
C:\Documents and Settings\Administrator>lsnrctl services listener
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 15-FEB-2012 10:00
:08
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.22.18)(PORT=1521)))
Services Summary...
Service "AFISETX" has 1 instance(s).
Instance "AFISETX", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "AFISl.PenCom.Local" has 1 instance(s).
Instance "AFISL", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
The command completed successfully
*****************************************************************
*****************************************************************
C:\Documents and Settings\Administrator>lsnrctl status listener
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 15-FEB-2012 10:03
:14
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.22.18)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date 15-FEB-2012 09:13:29
Uptime 0 days 0 hr. 49 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File G:\app\Administrator\product\11.2.0\dbhome_2\network\a
dmin\listener.ora
Listener Log File g:\app\administrator\diag\tnslsnr\oracle-discover\list
ener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.22.18)(PORT=1521)))
Services Summary...
Service "AFISETX" has 1 instance(s).
Instance "AFISETX", status UNKNOWN, has 1 handler(s) for this service...
Service "AFISl.PenCom.Local" has 1 instance(s).
Instance "AFISL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
************************************************************
|
|
|
|