Search code examples
c#oracle-databaseoracle11goracle-manageddataaccess

Oracle.ManagedDataAccess.Core and ORA-01017: invalid username/password; logon denied


I'm trying to connect to the oracle server (11g) with Oracle.ManagedDataAccess.Core 2.19.50 but receiving ORA-01017 error.

Current settings:

            OracleConfiguration.DirectoryServers = "(oid2.COMPANY.com:389:636, oid1.COMPANY.com:389:636)";
            OracleConfiguration.DirectoryType = @"OID";
            OracleConfiguration.DefaultAdminContext = @"dc=COMPANY,dc=com";
            OracleConfiguration.NamesDirectoryPath = "(LDAP, TNSNAMES)";
            OracleConfiguration.SqlNetAuthenticationServices = "(NONE)";

            OracleConfiguration.StatementCacheSize = 25;
            OracleConfiguration.BindByName = true;
            OracleConfiguration.CommandTimeout = 300;
            OracleConfiguration.FetchSize = 1024 * 1024;

            OracleConfiguration.TraceOption = 1;
            OracleConfiguration.TraceLevel = 7;
            OracleConfiguration.TraceFileLocation = @"C:\Temp";
            OracleConfiguration.SendBufferSize = 8192;
            OracleConfiguration.ReceiveBufferSize = 8192;
            OracleConfiguration.DisableOOB = true;

I've tried different SqlNetAuthenticationServices options, read traces (didn't find anything useful there).

Connection:

           using var connection =
                new OracleConnection(
                    $@"Data Source={this._system.DbName};Persist Security Info=False;",
                    new OracleCredential(userName, securePassword, OracleDBAPrivilege.None)
                );

At the same time SQL Navigator which is using regular windows Oracle client v11.2.0.4.0 works fine and can login (on the same machine).

I'm not an Oracle expert, but it looks like I miss some settings from client (which was installed here before me), do You have any suggestions where to look for a settings or may be I miss something.

P.S. as you can see from above - I've already extracted some settings from client settings like LDAP server names.


Solution

  • After some investigation I've discovered that Oracle.ManagedDataAccess.Core do not support 11g version of the server. And that's pretty much it, I've to readjust my project for 3rd party solution for Oracle DB connection.

    Shame on the Oracle backward compatibility.