gpt4 book ai didi

c# - Oracle.ManagedDataAccess OracleInternal.NotificationServices.ONSException

转载 作者:可可西里 更新时间:2023-11-01 08:49:57 26 4
gpt4 key购买 nike

我们使用“Oracle.ManagedDataAccess”ODP.NET 驱动程序来访问 Oracle 的数据库。

使用连接字符串连接数据库时:

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=10.40.40.38)(Port=1521)))(CONNECT_DATA=(SERVICE_NAME=D3T))); User Id=test; Password=test'

Internal error message:

OracleInternal.NotificationServices.ONSException**: ONS: No node lists have been configured' after opening the connection.

代码:

string connect = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=10.40.40.38)(Port=1521)))(CONNECT_DATA=(SERVICE_NAME=D3T))); User Id=test; Password=test";
OracleConnection connection = new OracleConnection(connect);
connection.Open();

与数据库的连接工作正常。但是配置内部有什么问题?

最佳答案

我发现此链接很有帮助: https://www.databaseusers.com/article/6046913/ONS%3A+No+node+lists+were+configured

基本上,您需要像这样配置 ONS,或禁用 LoadBalancing 和 HAEvents:

Oracle.ManagedDataAccess.Client.OracleConfiguration.LoadBalancing = false;
Oracle.ManagedDataAccess.Client.OracleConfiguration.HAEvents = false;

关于c# - Oracle.ManagedDataAccess OracleInternal.NotificationServices.ONSException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48170310/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com