0

I'm attempting to use the Oracle Managed Driver (v3.21.41) in a dotnet core project. I'm trying to get the driver to connect via LDAP, but it seems to always want to try (and fail) with TNS.

OracleConfiguration.DirectoryServers = "(oidserver:3060)";
OracleConfiguration.DirectoryServerType = "OID";
OracleConfiguration.DefaultAdminContext = "cn=OracleContext,dc=co,dc=company,dc=com";
OracleConfiguration.NamesDirectoryPath = "(LDAP)";
OracleConnection conn = new OracleConnection("Data Source=SERVERYO; User Id=usr; Password=pwd");
conn.Open();

I'm wondering if I am missing some property of OracleConfiguration for it actually try to use LDAP to resolve the server name. When I run this code I always get a TNS error:

'ORA-12154: TNS:could not resolve the connect identifier specified'

Jack B Nimble
  • 5,039
  • 4
  • 40
  • 62
  • Maybe have a look at this: https://stackoverflow.com/questions/30905910/odp-net-managed-library-does-resolve-alias-but-32-bit-library-does/30920849#30920849 – Wernfried Domscheit Dec 22 '21 at 15:26
  • @WernfriedDomscheit I've looked at it, I don't want to believe that the Oracle Managed Driver 6 years later still has the same LDAP flaw that I would need to look up the connection in that manner. Perhaps that is the answer, but I'm hoping there is way to just use the driver itself. – Jack B Nimble Dec 22 '21 at 15:46
  • I don't believe that either. Maybe check with [Process Monitor](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon) whether the application tries to query your LDAP server. – Wernfried Domscheit Dec 22 '21 at 16:35

0 Answers0