关于c#:OracleConnection中带有userId的[](方括号)的问题 | 珊瑚贝

Problems with [] (square brackets) with userId in OracleConnection


我正在尝试使用 Oracle.ManagedDataAccess 库连接到 Oracle 数据库,但用户包含方括号。问题是总是向我发送 Oracle 异常 ORA-01017: invalid username/password;登录被拒绝。

使用 SQL Developer 可以完美运行。

我正在使用 Oracle.ManagedDataAccess v18.6.0 和
.NET Framework 4.7.2

我确定其他参数,如 pass 和 host 是正确的。我尝试了另一个没有方括号并且效果很好的用户。

我的代码如下所示:

1
using (var conn = new OracleConnection(SERVER, new OracleCredential(“myId[SERV]”, secPwd)))

非常感谢。

  • 使用连接字符串我有同样的问题。


您正在使用代理用户身份验证

“myId”是您的代理用户,”SERV”是数据库用户

在此处查看如何在 .net 中与代理用户连接

基本上有两种可能:

1
  new OracleConnection(“Data Source=ORA; User Id=my_proxy_user; Password=my_proxy_user_password;”)

1
 new OracleConnection(“Data Source=ORA; Proxy User Id=my_proxy_user; Proxy Password=my_proxy_user_password; User Id=scott;”)

stackexchange上的类似问题

使用 Oracle Data Provider for .NET 进行代理身份验证的 Oracle 文档


来源:https://www.codenong.com/55577217/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9065.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?