我正在尝试使用 Oracle.ManagedDataAccess 库连接到 Oracle 数据库,但用户包含方括号。问题是总是向我发送 Oracle 异常 ORA-01017: invalid username/password;登录被拒绝。
与 SQL Developer 完美配合。
我正在使用 Oracle.ManagedDataAccess v18.6.0 并且 .NET框架4.7.2
我确信其他参数(例如 pass 和 host)都是正确的。我尝试与另一个没有方括号的用户一起使用,效果很好。
我的代码如下所示:
using (var conn = new OracleConnection(SERVER, new OracleCredential("myId[SERV]", secPwd)))
非常感谢。
最佳答案
您正在使用proxy user authentication
“myId”是您的代理用户,“SERV”是数据库用户
检查here如何与.net中的代理用户连接
基本上有两种可能性:
new OracleConnection("Data Source=ORA; User Id=my_proxy_user; Password=my_proxy_user_password;")
或
new OracleConnection("Data Source=ORA; Proxy User Id=my_proxy_user; Proxy Password=my_proxy_user_password; User Id=scott;")
关于 stackexchange 的类似问题
Oracle 文档 Proxy Authentication使用 Oracle Data Provider for .NET
关于c# - OracleConnection 中 userId 的 [](方括号)问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55577217/