Sunday, October 11, 2020

Application Continuity for the Oracle Database

Draining and Rebalancing Sessions for Planned Maintenance

For planned database maintenance, effectively managing active sessions is crucial to minimize disruption. Oracle provides several mechanisms to drain sessions and rebalance workloads, especially when integrated with connection pools and mid-tiers.

Session Draining

Session draining is a technique used to gracefully terminate sessions, allowing ongoing work to complete before the underlying resource (like a PDB or instance) is taken offline.

  • Fast Application Notification (FAN): Widely used with Oracle connection pools and mid-tiers, FAN enables the database to notify applications about upcoming changes (e.g., a node going down). This allows applications to drain their connections from the affected instance.
  • Database-Initiated Draining (Oracle Database 18c+): Starting with Oracle Database 18c, the database automatically drains sessions when PDBs or instances are stopped or relocated. This simplifies the draining process for administrators.

Failover Solutions

When sessions cannot be drained within the allocated time, failover solutions act as a fallback to ensure application continuity.

Transparent Application Failover (TAF)

TAF provides basic failover capabilities by creating a new session if the primary connection is lost.

  • SELECT Mode: When configured with SELECT mode, TAF can replay queries from the point of failure, allowing read-only operations to resume seamlessly on a new connection.
  • FAILOVER_RESTORE (12.2.0.1): This setting (Level1 by default, meaning None) automatically restores the initial common state before replaying a request.
  • FAILOVER_TYPE=AUTO (18c+): From Oracle Database 18c, setting FAILOVER_TYPE=AUTO automatically configures FAILOVER_RESTORE=AUTO, which is equivalent to Level1 behavior, providing more automated session restoration.

Application Continuity (AC)

Application Continuity is a more advanced failover solution designed to hide outages from applications, ensuring ongoing user experience.

  • Coverage: AC was introduced in Oracle Database 12.1 for thin Java applications and extended to OCI and ODP.NET based applications in Oracle Database 12.2.0.1.
  • Session Recovery: AC goes beyond TAF by rebuilding the entire session, including both session states (e.g., NLS settings, temporary tables) and transactional states, from a known good point after a recoverable outage.

Transparent Application Continuity (TAC)

Introduced in Oracle Database 18c, Transparent Application Continuity further enhances AC.

  • Automated State Tracking: TAC transparently tracks and records the session and transactional state. This automation allows the database session to be recovered following a recoverable outage without requiring explicit application code changes for state management.

https://www.oracle.com/technetwork/database/options/clustering/applicationcontinuity/applicationcontinuityformaa-6348196.pdf

No comments:

Post a Comment