Real Application Clusters and Global Data Services

This section discusses optimizations for the following products:

  • Oracle Real Application Clusters (Oracle RAC) is a cluster database with a shared cache architecture that overcomes the limitations of traditional shared-nothing and shared-disk approaches to provide highly scalable and available database solutions for business applications. See Oracle Real Application Clusters Administration and Deployment Guide.

  • Oracle Data Guard provides one or more standby databases to protect Oracle data from failures, disasters, human error, and data corruptions for high availability in mission critical applications. See Oracle Data Guard Concepts and Administration.

  • Oracle GoldenGate replicates data among heterogeneous data environments. It enables high availability solutions, real-time data integration, transactional change data capture, data replication, transformations, and verification between operational and analytical enterprise systems. See Oracle Database High Availability Overview.

  • Global Data Services (GDS), new in Oracle Database 12c, provides database workload management features across replicated databases, such as Data Guard and GoldenGate.

ODP.NET supports Oracle Real Application Clusters (Oracle RAC), Data Guard, and GoldenGate transparently, meaning you do not need to change ODP.NET code to use these Oracle components. To further take advantage of these technologies, ODP.NET offers connection pooling optimization features for achieving better application high availability and performance. You can do this through configuring ODP.NET to receive, respond, and send database status messages to .NET applications.

These optimization configurations include the use of features such as Fast Application Notification (FAN), Runtime Connection Load Balancing, and Fast Connection Failover (FCF).

These connection pooling optimizations can improve high availability and performance for Oracle Real Application Clusters and Global Data Services products:

Fast Application Notification

Fast Application Notification (FAN) is a high availability and load balancing notification mechanism that Oracle RAC, Data Guard, and GoldenGate use to notify ODP.NET applications about cluster configuration and service-level information, including status changes such as UP or DOWN events and server load. FAN UP and DOWN events can apply to instances, services, and nodes. Based on information received, ODP.NET can adjust its connection pool accordingly to improve application availability and performance. See Oracle Real Application Clusters Administration and Deployment Guide for more information about FAN.

With FAN, Oracle RAC, Data Guard, and GoldenGate use one of two Oracle messaging infrastructures to send notifications to ODP.NET applications:

  • Oracle Notification Service (ONS)

  • Oracle Streams Advanced Queueing (AQ).

Table 3-4 describes when each messaging system is used and the ODP.NET-related client configuration.

Table 3-4 Configurations for ODP.NET Driver Types

ODP.NET Driver Type Database Server Version FAN Infrastructure Configuration Manual ONS Configuration Locations

managed

12.1 and later

ONS

Automatic or Manual

Either of these two files:

  • .NET configuration file

  • ONS configuration file

managed

11.2 and earlier

ONS

Manual

Either of these two files:

  • .NET configuration file

  • ONS configuration file

unmanaged

12.1 and later

ONS

Automatic or Manual

oraaccess.xml file

unmanaged

11.2 and earlier

AQ

Automatic

N/A


To configure the .NET configuration file, see "onsConfig section". To configure the ONS configuration file, see "Client Side ONS Daemon Configuration". To configure oraaccess.xml, see Oracle Call Interface Programmer's Guide."

See "Configuring a Port to Listen for Database Notifications" for more information on AQ configuration for FAN.

For automatic ONS configuration, developers can add more nodes and ports for ODP.NET to listen to, in addition to the nodes and ports that ODP.NET obtains from the database automatically.

ODP.NET applications do not require code changes to migrate from the AQ to ONS FAN infrastructure. However, some ODP.NET client configuration changes may be necessary when migrating to ONS, a newer database server version, or from ODP.NET, Unmanaged Driver to the managed driver, as documented above.

On the database server side, FAN must be set up and configured.

Using FAN Messages from the database, ODP.NET can do the following:

  • With Runtime Connection Load Balancing, ODP.NET load balances connections among Oracle RAC nodes, services, and service members and GDS resources. This feature improves ODP.NET response time and ensures better resource allocation of server resources. See "Runtime Connection Load Balancing".

  • With the Fast Connection Failover (FCF) feature, Oracle RAC, Data Guard, and GoldenGate can inform the ODP.NET connection pool if database nodes, services, service members, or the databases have gone down. These DOWN messages indicate which connections in the pool are invalid and must be removed. See Oracle Database Development Guide.

Runtime Connection Load Balancing

With Runtime Connection Load Balancing, Oracle Data Provider for .NET balances work requests across Oracle RAC instances based on the load balancing advisory and service goal. Because workloads can constantly change, load balancing occurs when the application requests a new connection. Thus, ODP.NET optimizes service levels by connecting users to the least loaded nodes in real-time.

In Oracle Database 12c, Runtime Connection Load Balancing has been extended to Oracle Data Guard and Oracle GoldenGate so that ODP.NET 12c connections can be load balanced with these two database services as part of Global Data Services. No ODP.NET applications require code changes to use Global Data Services if they are already using Runtime Connection Load Balancing.

When Runtime Connection Load Balancing is enabled:

  • The ODP.NET connection pool dispenses connections based on the load balancing advisory and service goal.

  • The ODP.NET connection pool also balances the number of connections to each service member providing the service, based on the load balancing advisory and service goal.

By default, this feature is disabled. To enable runtime connection load balancing, include "Load Balancing=true" in the connection string. This feature can only be used if "pooling=true". If "Load Balancing=true" is set and the connection attempts to connect to a single-instance database, an OracleException is thrown with an error of "ORA-1031: insufficient privileges." In order to use Runtime Connection Load Balancing, specific Oracle server configurations must be set.

The following connection string example enables Runtime Connection Load Balancing:

"user id=scott;password=tiger;data source=erp;load balancing=true;"

See Also:

Fast Connection Failover (FCF)

When an Oracle RAC service, service member, node, or a Data Guard database fails, the severed ODP.NET connection objects may continue to exist in the application. If users attempt to use these invalid connections, they will encounter errors. FCF enables ODP.NET to free these severed connections proactively and quickly. Users then will be able to use the application after a server side failure without manual intervention from an administrator.

In Oracle Database 12c, FCF has been extended to Oracle Data Guard and Oracle GoldenGate for ODP.NET 12c connections through Global Data Services. No ODP.NET applications require code changes to use Global Data Services if they already use FCF.

ODP.NET applications can enable FCF through the High Availability Events, "HA Events", connection string attribute. When HA Events are enabled:

  • ODP.NET connection pool proactively removes connections from the pool when a Global Data Service or Oracle RAC service, service member, node, or database goes down.

  • ODP.NET proactively forces threads waiting for responses from the downed database to exit out from the existing call to avoid any hangs. When such a connection is then returned to the pool, any resource associated with that connection is freed.

  • ODP.NET establishes connections to existing Oracle instances if the removal of severed connections brings the total number of connections below the "min pool size", upon the next connection request.

By default this feature is disabled. To enable HA events, include "HA Events=true" and "pooling=true" in the connection string.

The following connection string example enables HA Events:

"user id=scott;password=tiger;data source=erp;HA events=true;"

See Also:

Using FCF Planned Outage to Minimize Service Disruption

FCF not only provides high availability services for unplanned outages, such as node failures, but also for planned outages, such as server repairs, upgrades, and changes, to minimize service disruption to ODP.NET application users.

When a database service is set to be stopped or relocated, a FAN message is published with a planned reason code. A FCF-aware ODP.NET connection pool ("HA Events=true") receives the notification and commences to close idle connections, no longer allowing new connections to that specific database service. Active connections to that specific database service remain until users complete their tasks and the connection is returned to the pool. Thus, no users must stop work mid-stream due to a planned outage.

Eventually, all users complete their tasks and no connections remain to that database service. The database administrator can then stop the service for the planned outage task. This feature allows the database service to be stopped as quickly as possible without end user disruption.

A typical planned outage scenario is as follows:

  1. There is a need to upgrade, patch, or repair a software or hardware issue on a database server. Relocate the service from the instance, then shut down the service on the instance.

  2. The FAN planned DOWN event clears idle sessions from the ODP.NET connection pool immediately and marks active sessions to be released at the next check-in. These FAN actions drain the sessions from this instance without disrupting the users.

    Existing connections on other instances remain usable, and new connections can be opened to these other instances.

  3. Not all sessions, in all cases, will check their connections into the pool. It is best practice to have a timeout period after which the instance is forcibly shut down, evicting any remaining client connections.

  4. Once the upgrade, patch, or repair is complete, restart the instance and the service on the original node. ODP.NET can now use the instance again.

Pool Size Attributes in an Oracle RAC Database

When connection pools are created for a single-instance database, pool size attributes are applied to the single service. Similarly, when connection pools are created for an Oracle RAC database, the pool size attributes are applied to a service and not to service members. For example, if "Min Pool Size" is set to N, ODP.NET does not create N connections for each service member. Instead, it creates, at minimum, N connections for the entire service, where N connections are distributed among the service members.

The following pool size connection string attributes are applied to a service.

  • Min Pool Size

  • Max Pool Size

  • Incr Pool Size

  • Decr Pool Size