Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

odbc error

Status
Not open for further replies.

gwu

MIS
Joined
Dec 18, 2002
Messages
239
Location
US
I set up oracle 10g on a linux box which seems to be working.I am trying to access it from as asp page with iis(windows 2000)/odbc. From what I have researched I need Instant Client 10g installed on the iis box. I have done this and created a TNSNAMES.ORA file in my TNS_ADMIN folder:

Code:
orcl=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.201)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
and set up an odbc entry using the mirosoft driver for oeracle. On the asp page I get this error:

Code:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC driver for Oracle][Oracle]ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

/aaa.asp, line 3


What am i doing wrong? Am I installing the correct software? do i need to set up mode ora files on the iis box?


thanks
 
Hi,
Is the listener running on the Database server:
That is, if you do a
tnsping orcl
from the web server ( try it in a command window)
do you get a connection?

On the 10G server, from command window,
try
lsnrctl status
and/or
lsnrctl services
and see what services are registered..


[profile]
 
from website box:
Code:
C:\Oracle\product\10.1.0\Client_1\BIN>tnsping 10.0.0.201

TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 10-NOV-2004 16:12:02

Copyright (c) 1997, 2003, Oracle.  All rights reserved.

Used parameter files:

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=10.0.0.201))(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.20
1)(PORT=1521)))
OK (20 msec)

from linux/oracle box:
Code:
[oracle@test root]$ lsnrctl status

LSNRCTL for Linux: Version 10.1.0.3.0 - Production on 10-NOV-2004 17:51:47

Copyright (c) 1991, 2004, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.1.0.3.0 - Production
Start Date                10-NOV-2004 16:57:17
Uptime                    0 days 0 hr. 54 min. 30 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/product/10g/network/admin/listener.ora
Listener Log File         /home/oracle/product/10g/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.test.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.test.com)(PORT=8080))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=test.test.com)(PORT=2100))(Presentation=FTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@test root]$

thanks
 
Hi,
OK,..But try
tnsping orcl

That will attempt to use your tnsnames.ora entry for
orcl
instead of the HOSTNAME method..

Can you post your connection object coding?

Like this one from one of my asp pages:
Code:
 myconn = Server.CreateObject("ADODB.Connection");
        myconn.ConnectionTimeout = 15;
	myconn.CommandTimeout = 30;
	myConnString="Provider=MSDAORA;Password=secret;UserID=myusername;Data Source=mytnsnamesentry;"
	myconn.ConnectionString=myConnString
	myconn.Open;

[profile]
 
here:
Code:
C:\Oracle\product\10.1.0\Client_1\BIN>tnsping orcl

TNS Ping Utility for 32-bit Windows: Version 10.1.0.2.0 - Production on 11-NOV-2
004 09:15:35

Copyright (c) 1997, 2003, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 10.0.0.201)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = orcl)))
OK (0 msec)

C:\Oracle\product\10.1.0\Client_1\BIN>

with this:
Code:
<% Dim objConn, objCmd, objRs
Set objConn = Server.CreateObject("ADODB.Connection")
Set objCmd = Server.CreateObject("ADODB.Command")
Set objRs = Server.CreateObject("ADODB.RecordSet")
Dim strConnection
strConnection = "PROVIDER=MSDAORA;DATA SOURCE=orcl;USER ID=test;PASSWORD=test;"
objConn.Open strConnection
%>

I get this:
Code:
Microsoft OLE DB Provider for Oracle error '80004005'

ORA-12154: TNS:could not resolve the connect identifier specified

/aaa.asp, line 7


thanks
 
Do I have the correct client software installed? I downloaded and installed the oracle 10g client. I have also tried "instant client".

thanks
 
Hi,
From the 10g docs:

Code:
ORA-12154: TNS:could not resolve the connect identifier specified 
Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.
Action: 
- If you are using local naming (TNSNAMES.ORA file):

- Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)

- Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.

- Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.

- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.

- If you are using directory naming:

- Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

- Verify that the LDAP directory server is up and that it is accessible.

- Verify that the net service name or database name used as the connect identifier is configured in the directory.

- Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier

- If you are using easy connect naming:

- Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

- Make sure the host, port and service name specified are correct.

- Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.

See if any of that helps..

[profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top