When connecting to Oracle Database 12c and later, ODP.NET uses Oracle Notification Service, rather than Advanced Queuing.
Enable Oracle Notification Service notifications by using SRVCTL, and set the run-time load balancing goal, as shown in the following example:
$ srvctl modify service -db crm -service odpapp.example.com -notification TRUE -clbgoal LONG -rlbgoal SERVICE_TIME
Ensure Oracle Notification Service (ONS) is configured for FAN events including run-time load balancing advice.
To take advantage of load balancing events with ODP.NET connection pools, set the load balancing attribute in the ConnectionString to
TRUE (the default is
FALSE). You can do this at connect time. This only works if you are using connection pools, or when the pooling attribute is set to
TRUE which is the default.
The following example demonstrates how to configure the ConnectionString to enable load balancing, where
user_name is the name of the user and
password is the password:
con.ConnectionString = "User Id=user_name;Password=password;Data Source=odpapp;" + "Min Pool Size=10;Connection Lifetime=120;Connection Timeout=60;" + "Load Balancing=true;Incr Pool Size=5;Decr Pool Size=2";
ODP.NET does not support connection redistribution when a node starts (UP events). However, if you have enabled failover on the server-side, then ODP.NET can migrate connections to newly available instances.
Oracle Data Provider for .NET Developer's Guide for Microsoft Windows for more information about ODP. NET
"srvctl modify service" for information about using this command