What is the function of Transparent Application Failover (TAF) ?
It is a feature that helps database connection sessions failover to a surviving database instance during an instance failure. It is a client-side failover and you can specify how to failover the session and re-establish the session on another node.
During an instance failure active DML transactions will be failed and rolled back and the application will receive an error message about the transaction failure. But, query operations such as SELECT statement get replayed after the connection is relocated to the new database instance and re-establish the session on another node.
The configuration of Transparent Application Failover (TAF) is done through the tnsnames.ora file on the client side.
DWDB= (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=DW-SCAN) (PORT=1521)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=DWDB) (FAILOVER_MODE= (TYPE=session) (METHOD=basic) (RETRIES=5) (DELAY=5) )))
The TAF settings for the failover method can be NONE, BASIC or PRECONNECT.
When the failover method is BASIC, transparent application failover re-establishes the connection to another instance only after failure of an instance occurs.
And when the failover method is PRECONNECT, the application preconnects a session to a backup instance. And this method speeds up the failover and is recommended especially in a two node RAC cluster.
The TAF settings for the failover type can be SESSION, SELECT or NONE. And using the SESSION mode, transparent application failover reconnects the session to another healthy instance and the new session has to start over again. But, when we use the SELECT mode, TAF reconnects the session to another instance and allows the query to reuse the open cursor from the previous session.