简体   繁体   中英

ORA-12541 TNS:no listener on Oracle.DataAccess connection open

My WCF service uses Oracle.DataAccess.Client to connect to oracle db. It has been running successfully for a year or so using the following connectionString:

OracleConnection conn = new OracleConnection(String.Format("USER ID=XXX;PASSWORD=XXX;DATA SOURCE={0}", db));

I recently got a new pc and had to re-install the Oracle client. I tried to add a new operationContract to my existing service and had to re-reference the newly-added ODAC. Suddenly, it won't connect anymore. It fails on the connection.open();

My TNSnames.ora file is in the same spot that it ever was. I even tried copying it to the project's bin directory just for grins.

TOAD works. I can tnsping my database successfully from OraHome. I can access the database using System.Data.OracleClient , but I don't want to rewrite everything in order to use a deprecated dll.

If the tnsnames is there, the paths are identified in my env variables, and the listener is running, what else should be checked? I did notice that the HKEY_LOCAL_MACHINE key for Oracle was pointing to the wrong OraHome path, but even when I modified the path it still wouldn't connect, so I put it back, afraid that I would make TOAD stop working too.

Any suggestions?

This error can happen if the user instantiating the connection doesn't have permission to run the Oracle client. Make sure that the account running the WCF service has the correct permissions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM