[英]ORA-01017: invalid username/password; logon denied when trying to connect via ODP.NET (Oracle.ManagedDataAccess.Client)
Following code throws: ORA-01017: invalid username/password;以下代码抛出:ORA-01017:无效的用户名/密码; logon denied
登录被拒绝
string constr = "User Id=Name;Password=Password;Data Source=server:1521/service";
OracleConnection con = new OracleConnection(constr);
con.Open();
SQL Developer, DBeaver connects without problems. SQL Developer、DBeaver 连接没有问题。 FIPS is disabled.
FIPS 已禁用。
System:系统:
I would be very thankful for any help!我将非常感谢您的帮助!
Assuming the password is correct (no offense, but 99.99% of the time, this error is because the password is wrong), one possible cause of this issue is case sensitivity and different password hash algorithms.假设密码正确(无意冒犯,但在 99.99% 的情况下,此错误是因为密码错误),此问题的一个可能原因是区分大小写和不同的密码哈希算法。
If you create a user with the password "PASSWORD", Oracle may create multiple different password hashes for it.如果您使用密码“PASSWORD”创建用户,Oracle 可能会为其创建多个不同的密码哈希。 One of the versions, meant to work with old clients, will work with either "PASSWORD" or "password".
其中一个版本旨在与旧客户端一起使用,可以使用“密码”或“密码”。 The newer version will only work with "PASSWORD".
较新的版本仅适用于“密码”。 So you might be always using the wrong password, you're just getting lucky with the old client.
所以你可能总是使用错误的密码,你只是因为老客户而走运。
Oracle password hashes are a real mess. Oracle 密码散列真是一团糟。 You can check things like the columns SYS.USER$.PASSWORD and SYS.USER$.SPARE4 for the hashes, or the SQLNET.ORA file for parameters meant to disable certain hashes.
您可以检查列 SYS.USER$.PASSWORD 和 SYS.USER$.SPARE4 的哈希值,或检查 SQLNET.ORA 文件中旨在禁用某些哈希值的参数。 But most of the time you're better off just re-creating the password and seeing if that works.
但大多数情况下,您最好重新创建密码并查看是否有效。
(And if this is indeed the case, don't learn the wrong lesson and try to disable old password hash algorithms. It is much harder than the manual implies.) (如果确实如此,请不要吸取错误的教训并尝试禁用旧的密码哈希算法。这比手册中暗示的要困难得多。)
I don' think that is a valid data source descriptor for ODP.net.我认为这是 ODP.net 的有效数据源描述符。 See:
看:
https://stackoverflow.com/a/31592492/852208 https://stackoverflow.com/a/31592492/852208
Edited: It looks like you are using the ezconnect format, but that requires the username and password to be inline: https://www.connectionstrings.com/oracle-data-provider-for-net-odp-net/using-the-easy-connect-naming-method-aka-ez-connect/编辑:看起来您正在使用 ezconnect 格式,但这需要内联用户名和密码: https ://www.connectionstrings.com/oracle-data-provider-for-net-odp-net/using-the -easy-connect-naming-method-aka-ez-connect/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.