I\'m trying to use the Oracle ODP.NET 11g (11.1.0.6.20) Instant Client on my ASP.net project as a Data Provider but when I run the aspx pag
Lots of theoretical answers here, but here comes a working example with code that you can copy and paste and test immediately:
HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.112.4.0\DllPath
. On 64 bit machines write additionally to HKLM\SOFTWARE\Wow6432Node\Oracle\...
HKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ODP.NET\4.121.2.0\DllPath
Oracle.ManagedDataAccess.dll
which is only 4 MB and is a pure managed DLL which works in 32 bit and 64 bit processes as well and depends on no other DLL and does not require any registry entries.using Oracle.DataAccess.Client; or using Oracle.ManagedDataAccess.Client; .... string oradb = "Data Source=(DESCRIPTION=" + "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.158)(PORT=1521)))" + "(CONNECT_DATA=(SERVER=DEDICATED)));" + "User Id=SYSTEM;Password=xxx;"; using (OracleConnection conn = new OracleConnection(oradb)) { conn.Open(); using (OracleCommand cmd = new OracleCommand()) { cmd.Connection = conn; cmd.CommandText = "select TABLESPACE_NAME from DBA_DATA_FILES"; using (OracleDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { listBox.Items.Add(dr["TABLESPACE_NAME"]); } } } }
I encountered this problem after I installed Oracle Data Tools for Visual Studio 2015, and then fighting with Oracle for a good hour. I decided to try reinstalling Oracle client again instead of this mess with file copying, config changes, etc., and that worked for me.
I had the same issue with Oracle.DataAccess.dll v4.121.2.0. with 2- homes installation (32 and 64 bit versions). 32-bit version workerd, 64-bit version didn't.
In my case (after 2 days of trying) I found that the problem was permissions on the 64-bit-home version. Many Directories in that version had exclusively overridden permissions where "Authenticated Users" role did not have "Read" access, which is set by default on the parent directory. Those sub-directories included "bin", "network/admin", "nls", "oracore", "RDBMS" and possibly others. I found them by filtering out "ACCESS DENIED" result in "Process Monitor" (Procmon.exe) utility from sysinternals. Once the permissions were inherited from the parent directory to those child subdirectories everything started to work.
I didn't what to override the permissions on the whole oracle home so I did them one directory at a time, but I guess if you don't worry about security so much you can reset it on the whole corresponding oracle home directory.