TNS:could not resolve the connect identifier specified
496343Mar 21 2006 — edited Jul 27 2006I am at the end of my rope and I would really appreciate some assistance.
I get the error: "TNS:could not resolve the connect identifier specified " from my ASP pages and "Warning: oci_connect() [function.oci-connect]: Error while
trying to retrieve text for error ORA-12154" when connecting from php pages.
I am trying to access these pages from the same server as the database.
I manage to connect to the database homepage, but only after I manually stop and start the database after a restart (why?).
I have been reading forums and I have been googling for days. I think this is what you guys need to know to be able to help me.
-----------------------------------------------------------------------------------------------
General information:
Oracle Database 10g Express Edition Universal
Windows Server 2003 Standard SP 1
IIS 6
PHP Version 5.1.2
ASP allowed "normal" scrips runs ok
Php Allowed "normal" scrips runs ok
system variable path
C:\oraclexe\app\oracle\product\10.2.0\server\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\php;C:\instantclient_10_2
(server has been rebooted since last editing)
IUSR_Curium has full control on following folders including subfolders:
c:\windows\temp
C:\oraclexe
C:\instantclient_10_2
IWAM_Curium
IUSR_Curium has full control on following folders including subfolders:
c:\windows\temp
C:\oraclexe
C:\instantclient_10_2
HTTP access is set to "Available from local server and remote clients"
All oracle related services except OracleJobSchedulerXE is set to Automatic and is in status started
I can ping curium and i get a response from the server's public IP-Adress
I can ping localhost and i get a response from 127.0.0.1
-----------------------------------------------------------------------------------------------
This is my connection in ASP:
Set OraConn = Server.CreateObject("ADODB.Connection")
Oraconn.ConnectionString = "Driver={Microsoft ODBC for Oracle};Server=xe;Uid=hr;Pwd=hr;"
ASP connection gives the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:could not resolve the connect identifier specified
/asptest/test.asp, line 5
-----------------------------------------------------------------------------------------------
This is my connection in php
$conn = oci_connect('hr', 'hr', 'xe');
PHP connection gives the following error:
Warning: oci_connect() [function.oci-connect]: Error while trying to retrieve text for error ORA-12154 in c:\Inetpub\wwwroot\index1.php on line 3
Error while trying to retrieve text for error ORA-12154
-----------------------------------------------------------------------------------------------
C:\>lsnrctl status
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 21-MAR-2006 22:09:01
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production
Start Date 21-MAR-2006 20:57:04
Uptime 0 days 1 hr. 11 min. 58 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Default Service XE
Listener Parameter File C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\listener.ora
Listener Log File C:\oraclexe\app\oracle\product\10.2.0\server\network\log\listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC_FOR_XEipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=curium)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=curium)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully
-----------------------------------------------------------------------------------------------
C:\>lsnrctl services
LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 21-MAR-2006 22:11:39
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0
LOCAL SERVER
Service "XEXDB" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:38 refused:0 current:24 max:1002 state:ready
DISPATCHER <machine: CURIUM, pid: 1972>
(ADDRESS=(PROTOCOL=tcp)(HOST=curium)(PORT=1045))
Service "XE_XPT" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:ready
LOCAL SERVER
Service "xe" has 1 instance(s).
Instance "xe", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:1 refused:0 state:ready
LOCAL SERVER
The command completed successfully
-----------------------------------------------------------------------------------------------
C:\>tnsping XE
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 21-MAR-2
006 22:14:10
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = curium)(
PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))
OK (10 msec)
-----------------------------------------------------------------------------------------------
C:\>sqlplus system/xxxxx as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Ti Mar 21 22:15:38 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
-----------------------------------------------------------------------------------------------
C:\>sqlplus hr/hr@XE
SQL*Plus: Release 10.2.0.1.0 - Production on Ti Mar 21 22:15:21 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
-----------------------------------------------------------------------------------------------
C:\>sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Ti Mar 21 22:15:02 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
-----------------------------------------------------------------------------------------------
Litener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\10.2.0\server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
(ADDRESS = (PROTOCOL = TCP)(HOST = curium)(PORT = 1521))
)
)
DEFAULT_SERVICE_LISTENER = (XE)
-----------------------------------------------------------------------------------------------
sqlnet.ora
# 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)
-----------------------------------------------------------------------------------------------
tsnames.ora
XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = curium)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
-----------------------------------------------------------------------------------------------
Sorry for the long post....
Best regards
Roy-Christian Natland
Norway