When Oracle Net Services establishes a connection to an instance, the connection remains open until the client closes the connection, the instance is shutdown, or a failure occurs. If you configure transparent application failover (TAF) for the connection, then Oracle Database replays the session at a surviving instance when an outage occurs.
TAF can restart a query after failover has completed but for other types of transactions, such as INSERT
, UPDATE
, or DELETE
, the application must rollback the failed transaction and resubmit the transaction. You must also reexecute any session customizations, in other words, ALTER SESSION
statements, after failover has occurred. However, with TAF, a connection is not moved during normal processing, even if the workload changes over time.
Services simplify the deployment of TAF. You can define a TAF policy for a service, and all connections using this service will automatically have TAF enabled. This does not require any client-side changes. The TAF setting on a service overrides any TAF setting in the client connection definition.
You can define a TAF policy for all users of a service by defining the -failovermethod
and -failovertype
parameters. You can further define the TAF policy by setting the number of times that a failed session attempts to reconnect to the service and how long it should wait between reconnection attempts using the -failoverretry
and -failoverdelay
parameters, respectively.
To define a TAF policy for a service, use SRVCTL as in the following example, where the service name is tafconn.example.com
and the database name is CRM:
$ srvctl modify service -db crm -service tafconn.example.com -failovermethod BASIC -failovertype SELECT -failoverretry 10 -failoverdelay 30
OCI applications with TAF enabled should use FAN high availability events for fast connection failover.
See Also:
Oracle Database Net Services Administrator's Guide for more information about configuring TAF