17

We use the 'Oracle.ManagedDataAccess' ODP.NET driver for database access to Oracle.

When connecting to the database with the connection string:

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.

code:

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();

The connection to the database is working fine. But what is internally wrong with the configuration?

sampathsris
  • 21,564
  • 12
  • 71
  • 98
J. Deing
  • 171
  • 1
  • 6
  • Does [this page](https://blogs.oracle.com/weblogicserver/ons-configuration-in-wls) help? – stuartd Jan 09 '18 at 15:07
  • The ONS service is not started or configured on the Oracle server. Why do I get this error? – J. Deing Jan 10 '18 at 09:54
  • The ons. config on the server has the following content: localport=6150 remoteport=6250 nodes=10.40.40.38:6250 But the ONS service (onsctl) is not started. – J. Deing Jan 10 '18 at 09:57
  • I get this after switching from Devart to the Oracle .NET Core 2 beta driver. – Kody Jun 04 '18 at 20:14
  • I have the same issue. Did you ever resolve it? – Postlagerkarte Aug 03 '18 at 14:49
  • No unfortunately not – J. Deing Aug 06 '18 at 11:16
  • 1
    I have the same issue when I starting my application. I get `'OracleInternal.NotificationServices.ONSException' in Oracle.ManagedDataAccess.dll` six times when I openning the connection. – honzakuzel1989 Sep 04 '18 at 08:25
  • I've had to ignore these 6 exceptions for years... The only advice I have is that they are hidden when you check the 'Enable Just My Code' setting (under Visual Studio -> Tools -> Debugging -> General). – Thracx Jan 21 '19 at 17:12
  • What happens if you omit the "ADDRESS_LIST=()" part in the connection string? I also use the ODP.NET managed driver and have never saw this error. "ONS" has something to do with load balancing. I found this about ONS: _"Remember that the URL needs a separate ADDRESS_LIST for each cluster and set LOAD_BALANCE=ON per ADDRESS to expand SCAN names."_ – Tim van Lint May 02 '19 at 13:33

5 Answers5

8

I found this link helpful: https://www.databaseusers.com/article/6046913/ONS%3A+No+node+lists+were+configured

Basically, you need to configure ONS, or disable LoadBalancing and HAEvents like so:

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

Thanks to Jacob Peterson.

But if you are unable to find the mentioned setting in C# code then configure your config as below. "Add settings if the block is already there"

<oracle.manageddataaccess.client>
    <version number="*">
      <settings>
        <setting name="LoadBalancing" value="false" />
        <setting name="HAEvents" value="false" />
      </settings>      
    </version>   
  </oracle.manageddataaccess.client>
4

We configure the OracleConnection with a single connection string (without any xml).
Setting those two parameters is possible using the following names, the other parts are for example and not relevant for this problem.

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mydbhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=myservicename)));load balancing=false;ha events=false;Min Pool Size=1;Incr Pool Size=1;user id=mydbuser

WarpEnterprises
  • 155
  • 1
  • 8
2

I am using ODP.NET Managed Client for years and never saw those OSN exceptions until recent updates when migrating to .NET Core and using Oracle.ManagedDataAccess and Oracle.ManagedDataAccess.Core Nuget packages.

Thanks to Jacob Peterson and other members who suggested to either ignore or disable the both properties "LOAD BALANCING=False;HA Events=False". Each one generates 3 exceptions if enabled on opening connection.

I assume that the new releases suppose that those features are enabled regardless if the server and/or connection string were prepared for that.

So, I suggest to ignore them or append disabled values to the connection string.

-1

I faced the same issue and fixed it if I add "load balancing=false;ha events=false" in my conn string.

  • 1
    This is the same solution as in [this other answer](https://stackoverflow.com/a/64067922/2227743). – Eric Aya Jul 14 '21 at 12:43