Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem on using ODP.Net

I've successfully used Oracle Database 11g Release 2 (11.2.0.1.0) to connect oracle from .Net. (in reference Oracle.DataAccess.dll version was 2.112.1.0).

But when I installed ODP.NET and when I am trying to connect to oracle, it gives me an error: "ORA-12154: TNS:could not resolve the connect identifier specified".

How can I solve this problem?

Thanks!

like image 307
Vano Maisuradze Avatar asked May 19 '11 12:05

Vano Maisuradze


2 Answers

This usually occurs when your oracle client is not in the PATH of your computer.

Make sure that the PATH environment variable contains both <Oracle client path> and <Oracle client path>\bin.

Also, this can happen if the SID of the database you want to connect to is simply not defined in the tnsnames.ora file under your oracle client installation path. If I recall correctly - it is under <Oracle client path>\network\admin\tnsnames.ora

Edit: The registry should contain an ORACLE entry set under: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\
There should be a key named HOME0 with string values: ORACLE_HOME and ID. I assume there are other values required as well - but those two I'm sure of. Check that ORACLE_HOME points correctly to the oracle client location.

like image 136
RonK Avatar answered Sep 28 '22 01:09

RonK


Copy the TNSNAMES.ORA from the oracle home that works into the Oracle home that does not.

http://www.oracle.com/technetwork/topics/dotnet/odt-faq-085407.html#ORA-12154:_TNS:could_not_resolve_the

like image 26
Christian Shay Avatar answered Sep 28 '22 00:09

Christian Shay