问题
We have upgraded Oracle to 19C and also upgraded the Oracle.ManagedDataAccess package to 19.6. However, when we try to open our application on Oracle database 12 then it is showing error, as some machines still has Oracle 12 (Old) database. can someone please share the Oracle Data Provider (ODP.Net) compatibility details with Oracle Clients?
回答1:
The error message does not indicate any incompatibility. Looks like the Oracle.ManagedDataAccess driver does not find your tnsnames.ora
file
Have a look at Oracle Data Provider for .NET, Managed Driver Configuration
Did you define a
TNS_ADMIN
environment variable?Did you define
TNS_ADMIN
in your Registry atHKEY_LOCAL_MACHINE\SOFTWARE\Oracle\OraClient19Home1
resp.HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Oracle\OraClient19Home1_32bit
?Documentation states that Registry is not read but for verion 19 I am not sure about that
Did you define the
TNS_ADMIN
in .NET config file?The easiest way to set it there would be the
OraProvCfg.exe
tool. Would be similar to this:
For 64-bit:
c:\oracle\product\12.1\Client_x64\ODP.NET\bin\4\OraProvCfg.exe /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:C:\oracle\product\12.1\Client_x64\odp.net\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:C:\oracle\network\admin
For 32-bit:
c:\oracle\product\12.1\Client_x86\ODP.NET\bin\4\OraProvCfg.exe /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:C:\oracle\product\12.1\Client_x86\odp.net\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:C:\oracle\network\admin
来源:https://stackoverflow.com/questions/60052285/oracle-client-and-odp-net-version-compatibility