Unix Technical Forum

Connection errors (ORA-12504) from .NET application

This is a discussion on Connection errors (ORA-12504) from .NET application within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Folks, I have the Enterprise Library 2.0 (January 2006), C# .NET, and an Oracle database. I am trying to ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 11:57 AM
ajmastrean
 
Posts: n/a
Default Connection errors (ORA-12504) from .NET application

Folks,

I have the Enterprise Library 2.0 (January 2006), C# .NET, and an
Oracle database. I am trying to query the database using the Data
Access Application Block (DAAB), but I get an ORA-12504 error. My
connection string should be fine, as the
DatabaseFactory.CreateDatabase("[dbname]") command runs without error.

The connection string is...
* * *
<add name="[dbname]" connectionString="data
source=[dbpath];Server=[serverpath];User
ID=[userid];Password=[password];"providerName="System.Data.OracleClient"
/>
* * *

The error occurs on the ExecuteDataSet() function <ds =
db.ExecuteDataSet(dbCommand);>. And reads...

* * *
Unhandled Exception: System.Data.OracleClient.OracleException:
ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
* * *

I have the Oracle XE (10g Express Edition) client installed. And we are
resolving the naming with LDAP. TNSPING for the database in question...

* * *
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on
12-DEC-2
006 10:59:32

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

Used parameter files:
C:\oraclexe\app\oracle\product\10.2.0\server\netwo rk\admin\sqlnet.ora

Used LDAP adapter to resolve the alias
Attempting to contact
(DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS_LIST=(ADDR ESS=(PRO
TOCOL=TCP)(HOST=[hostaddress])(PORT=1521)))(CONNECT_DATA=(SID=[dbname])
(SRVR=DEDICATED)))
OK (50 msec)
* * *

Now, I am not an Oracle wizard (or even apprentice, for that matter).
So, perhaps my Oracle setup is incorrect, but for now I am concerned
that I the .NET side is doing something screwy.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 11:57 AM
What's in a namespace
 
Posts: n/a
Default Re: Connection errors (ORA-12504) from .NET application


"ajmastrean" <ajmastrean@gmail.com> schreef in bericht
news:1166023687.571968.186760@j44g2000cwa.googlegr oups.com...
> Folks,
>
> I have the Enterprise Library 2.0 (January 2006), C# .NET, and an
> Oracle database. I am trying to query the database using the Data
> Access Application Block (DAAB), but I get an ORA-12504 error. My
> connection string should be fine, as the
> DatabaseFactory.CreateDatabase("[dbname]") command runs without error.
>
> The connection string is...
> * * *
> <add name="[dbname]" connectionString="data
> source=[dbpath];Server=[serverpath];User
> ID=[userid];Password=[password];"providerName="System.Data.OracleClient"
> />
> * * *
>
> The error occurs on the ExecuteDataSet() function <ds =
> db.ExecuteDataSet(dbCommand);>. And reads...
>
> * * *
> Unhandled Exception: System.Data.OracleClient.OracleException:
> ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA
> * * *
>
> I have the Oracle XE (10g Express Edition) client installed. And we are
> resolving the naming with LDAP. TNSPING for the database in question...
>
> * * *
> TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on
> 12-DEC-2
> 006 10:59:32
>
> Copyright (c) 1997, 2005, Oracle. All rights reserved.
>
> Used parameter files:
> C:\oraclexe\app\oracle\product\10.2.0\server\netwo rk\admin\sqlnet.ora
>
> Used LDAP adapter to resolve the alias
> Attempting to contact
> (DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS_LIST=(ADDR ESS=(PRO
> TOCOL=TCP)(HOST=[hostaddress])(PORT=1521)))(CONNECT_DATA=(SID=[dbname])
> (SRVR=DEDICATED)))
> OK (50 msec)
> * * *
>
> Now, I am not an Oracle wizard (or even apprentice, for that matter).
> So, perhaps my Oracle setup is incorrect, but for now I am concerned
> that I the .NET side is doing something screwy.
>

Note that your SID should be XE and nothing but XE!


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 11:57 AM
Jim Smith
 
Posts: n/a
Default Re: Connection errors (ORA-12504) from .NET application

In message <45803eef$0$322$e4fe514c@news.xs4all.nl>, What's in a
namespace <xml@ns.com> writes
>
>"ajmastrean" <ajmastrean@gmail.com> schreef in bericht
>news:1166023687.571968.186760@j44g2000cwa.googleg roups.com...
>> Folks,
>>
>> I have the Enterprise Library 2.0 (January 2006), C# .NET, and an
>> Oracle database. I am trying to query the database using the Data
>> Access Application Block (DAAB), but I get an ORA-12504 error. My
>> connection string should be fine, as the
>> DatabaseFactory.CreateDatabase("[dbname]") command runs without error.
>>
>> The connection string is...
>> * * *
>> <add name="[dbname]" connectionString="data
>> source=[dbpath];Server=[serverpath];User
>> ID=[userid];Password=[password];"providerName="System.Data.OracleClient"
>> />

>Note that your SID should be XE and nothing but XE!
>
>

The OP is using the XE client, not necessarily the server.

Can you connect to the database using sqlplus? TNSPING only checks that
the listener knows about the database, not that it is actually
available. The message looks like a listener configuration error.

Can you provide some real values for [dbname], [serverpath]. If
possible, can you run "lsnrctl status" on the server and post the
output. [dbname] etc should match values in the listner configuration


--
Jim Smith
Ponder Stibbons Limited <http://oracleandting.blogspot.com/>
RSS <http://oracleandting.blogspot.com/atom.xml>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 11:57 AM
ajmastrean
 
Posts: n/a
Default Re: Connection errors (ORA-12504) from .NET application

> The OP is using the XE client, not necessarily the server.
This is true. The server is Oracle 9i.

> Can you connect to the database using sqlplus?

I can connect with sqlplus and another tool, sql developer. The
database is on an highly available system.

> Can you provide some real values for [dbname], [serverpath].

Potentially, inquiring with legal and senior personnel...

> ... can you run "lsnrctl status" on the server and post the
> output. [dbname] etc should match values in the listner configuration

I only have cursory knowledge of the system setup, but the server is
showing an alias name of the database I am trying to connect to. Is
this normal? or does this indicate some oddball addressing scheme?
(here's wishing I could use names/addresses, although I ensured that
anywhere I put something like [dbname], it was equal to any other
occurence of the name).

LSNRCTL STATUS on [servername]
* * *
C:\>lsnrctl status [servername].[serveraddress]
*note, I guess I called these
2 fields [serverpath] earlier*

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on
14-DEC-2006 06:11
:04

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

Connecting to
(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRES S=(PROTOCOL=TCP)
(HOST=[serveripaddress])(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias [dbname]
Version TNSLSNR for HPUX: Version 9.2.0.6.0 -
Production
Start Date 02-MAR-2006 13:13:34
Uptime 248 days 13 hr. 13 min. 56 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File
/opt/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File
/opt/oracle/product/9.2.0/network/log/[dbname].log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)) )
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=[servername])(PORT=1521)))
Services Summary...
Service "[dbname].[dbaddress]" has 1 instance(s).
Instance "[dbname]", status READY, has 1 handler(s) for this
service...
Service "[some other db].[its address]" has 1 instance(s).
Instance "[dbname]", status READY, has 1 handler(s) for this
service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this
service...
The command completed successfully
* * *

LSNRCTL STATUS on [dbname]
* * *
C:\>lsnrctl status [dbname].[dbaddress]

LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on
14-DEC-2006 06:11
:16

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

Connecting to
(DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS=(PROTOCOL= TCP)(HOST=[servername].[serveraddress])(PORT=1521))(CONNECT_DATA=(SID=[dbname])(SRVR=DEDICATED)))
STATUS of the LISTENER
------------------------
Alias [dbname]
Version TNSLSNR for HPUX: Version 9.2.0.6.0 -
Production
Start Date 02-MAR-2006 13:13:34
Uptime 248 days 13 hr. 13 min. 56 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File
/opt/oracle/product/9.2.0/network/admin/listener.ora
Listener Log File
/opt/oracle/product/9.2.0/network/log/[dbname].log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)) )
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=[servername])(PORT=1521)))
Services Summary...
Service "[dbname].[dbaddress]" has 1 instance(s).
Instance "[dbname]", status READY, has 1 handler(s) for this
service...
Service "[some other db].[its address]" has 1 instance(s).
Instance "[dbname]", status READY, has 1 handler(s) for this
service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this
service...
The command completed successfully
* * *

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-08-2008, 11:58 AM
ajmastrean
 
Posts: n/a
Default Re: Connection errors (ORA-12504) from .NET application

I removed the "server=..." portion of the connection string and
everything runs fine.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:11 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com