0

Does anyone know if ODP.NET Managed Access (Oracle.ManagedDataAccess 12.2) support LDAP with the Entity Frameworks tools (vs 2017 Entity Framework 6.2)? The DBA inhibited access through TNS, so I no longer unable to connect to database to update the data models. The error message I received was ORA-12154 TNS could not resolve the connect identifier specified.

I tried to include the LDAPSetting in the app.net, but that didn't work. Is there any way I could still use the Entity Framework tools to update these data models?

zabop
  • 6,750
  • 3
  • 39
  • 84

1 Answers1

0

Most likely the ODP.NET Managed Driver does not find your sqlnet.ora and ldap.ora files.

Did you set NAMES.DIRECTORY_PATH = (LDAP, ...) in your sqlnet.ora file?

You can define location of sqlnet.ora and ldap.ora files also by TNS_ADMIN environment variable or in machine.config with a script similar to this:

set TNS_ADMIN=C:\oracle\network\admin

set Oracle_x64=c:\oracle\product\12.2\Client_x64\odp.net
"%Oracle_x64%\managed\x64\OraProvCfg.exe" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%


set Oracle_x86=c:\oracle\product\12.2\Client_x86\odp.net
"%Oracle_x86%\managed\x86\OraProvCfg.exe" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%

If it does not help, here would be a workaround: ODP.NET Managed library does resolve alias, but 32-bit library does. However, on my machine LDAP resolution works fine with ODP.NET Managed Driver. Perhaps have also a look at Oracle Data Provider for .NET, Managed Driver Configuration

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • Thank you Wernfried for the details on LDAP. My issue is mainly with the Entity Framework Update Wizard. I built a number of Data Models using the Entity Framework Tool when I was still able to connect to my Oracle Database using TNS connection string. Now that we moved to LDAP, I am unable to connect to the Oracle database using the Wizard to update the Models. It appears the Update Wizard only supports TNS and EZConnect. Any idea how I could make the Update Wizard recognize the LDAP settings? Thank you. – Lana Kadooka Sep 11 '18 at 21:39
  • Did you set `TNS_ADMIN` environment variable? What is the content of `sqlnet.ora` file? – Wernfried Domscheit Sep 12 '18 at 06:25