Configure Application Continuity on Autonomous AI Database

To configure Application Continuity you must enable application continuity for the database service your application uses and configure the failover type and the drain timeout. In addition, you must set several connection string parameters that enable high availability.

Configure Your Service to Enable Application Continuity

Use DBMS_APP_CONT_ADMIN to enable Application Continuity or Transparent Application Continuity:

Find the Service Name Parameter for Application Continuity

Depending on your workload type, use a command similar to the following to SELECT from DBA_SERVICES on your database and identify the service where you want to enable Application Continuity:

Notice the FAILOVER_TYPE for the high service has the no value and indicates that Application Continuity is disabled.

Verify Application Continuity is Enabled for a Service

Depending on your workload type, check the output of the query on DBA_SERVICES to verify that Application Continuity is enabled.

The FAILOVER_TYPE value for the high service is now AUTO, indicating that Transparent Application Continuity (TAC) is enabled and the FAILOVER_TYPE value for the tpurgent service is now TRANSACTION, indicating that Application Continuity (AC) is enabled.

Use Fast Application Notification (FAN)

When connecting to Autonomous AI Database, the Oracle database auto-configures FAN. For application deployments with Autonomous AI Database, Fast Application Notification (FAN) events for unplanned outages are directed to the connection manager (CMAN) and no client application configuration steps required to use FAN.

FAN is automatically handled for you by the client driver and by the Autonomous AI Database Connection Manager (CMAN):

See Client Configuration for Continuous Availability on Autonomous AI Database for more information.

Configure Connection String for High Availability

To maintain high availability, Oracle recommends that you set certain connection string parameters when you connect to Oracle Autonomous AI Database.

Set the CONNECT_TIMEOUT, RETRY_DELAY, RETRY_COUNT, andTRANSPORT_CONNECT_TIMEOUT parameters in the connection string when you connect to Oracle Autonomous AI Database. The connect strings embedded in the Oracle-supplied tnsnames.ora file are preconfigured with appropriate values for most applications. In some cases, depending on your applications needs, you may need to change the preconfigured values for a connection string.

Use this TNS for all Oracle clients version 12.2 or higher:

alias =
(DESCRIPTION =
(CONNECT_TIMEOUT= 90)(RETRY_COUNT=50)
(RETRY_DELAY=3)(TRANSPORT_CONNECT_TIMEOUT=3)
(ADDRESS_LIST =
  (LOAD_BALANCE=on)
  (ADDRESS = (PROTOCOL = TCP)(HOST=scan-host)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME = service-name)))

Use the following for JDBC connections using Oracle driver version 12.1 or earlier:

alias =
(DESCRIPTION =
(CONNECT_TIMEOUT= 15)(RETRY_COUNT=50)
(RETRY_DELAY=3)
(ADDRESS_LIST =
   (LOAD_BALANCE=on)
   (ADDRESS = (PROTOCOL = TCP)(HOST=scan-host)(PORT=1521)))
 (CONNECT_DATA=(SERVICE_NAME = service-name)))

Notes for connection strings:

See Download Client Credentials (Wallets) for information on the tnsnames.ora file.

Configure Driver Specific Client Options

Depending on your client and your driver, you need to assure that the client is properly configured to use Application Continuity when you connect to Autonomous AI Database

Configure JDBC Thin Driver

Shows details to use Application Continuity with Autonomous AI Database with a client using the JDBC Thin Driver.

If your application uses the JDBC Thin Driver, follow these recommended practices:

  1. Use JDBC Statement Cache for Coverage and Performance.

    For best coverage and performance, use the JDBC driver statement cache in place of an application server statement cache. This allows the driver to know that statements are closed and memory is to be freed at the end of requests.

    To use the JDBC statement cache, use connection property oracle.jdbc.implicitStatementCacheSize (OracleConnection.CONNECTION_PROPERTY_IMPLICIT_STATEMENT_CACHE_SIZE). The statement cache is per connection. The value for the cache size matches your number of open_cursors. For example:

    oracle.jdbc.implicitStatementCacheSize=nnn where nnn is typically between 10 and 100 and is equal to the number of open cursors your application maintains.

  2. Tune the Garbage Collector.

    For many applications the default Garbage Collector tuning is sufficient. For applications that return and keep large amounts of data you can use higher values, such as 2GB or larger. For example:

    java -Xms3072m -Xmx3072m

    It is recommended to set the memory allocation for the initial Java heap size (ms) and maximum heap size (mx) to the same value. This prevents using system resources on growing and shrinking the memory heap.

  3. When using the Universal Connection Pool (UCP), disable Fast Connection Failover. For example:

    PoolDataSource.setFastConnectionFailoverEnabled(false)

Configure Oracle Call Interface (OCI) Driver

Shows details to use Application Continuity with Autonomous AI Database with a client using the Oracle Call Interface (OCI) driver.

If the client application uses the Oracle Call Interface (OCI) Driver, follow this recommended practice:

Do not configure ONS servers in oraaccess.xml:

<ons>
   <servers>
   <!-Do not enter any values -->
   </servers>
</ons>

Also, for Autonomous AI Database Serverless, do not configure the \<fan\> section:

<fan>
<!-- only possible values are "trace" or "error" -->
    <subscription_failure_action>
   </subscription_failure_action>
</fan>

Configure ODP.NET Unmanaged Provider Driver

Shows details to use Application Continuity with Autonomous AI Database with a client using the ODP.NET Unmanaged Provider Driver.

The ODP.NET Unmanaged Provider driver automatically uses Application Continuity when Application Continuity is enabled on the database service that your application uses to connect to Autonomous AI Database.

When connecting an ODP.NET application to your Autonomous AI Database Serverless, do not configure ONS servers in oraaccess.xml:

<ons>
   <servers>
   <!-Do not enter any values -->
   </servers>
</ons>