Sunday, December 7, 2014

How to Configure Oracle RAC and TAF

This article describes Transparent Application Failover (TAF) and provides configuration details for 11gR2(11.2) cluster database.

There are two types of failover:
SESSION: Session Failover re-creates the connections and sessions to the surviving instance.
SELECT:  In addition to recreating the session, Select Failover also replays the select queries that were in progress.

There are two methods in which TAF establishes the failover connection:
BASIC: The second connection is re-established only after the first connection to the instance failed.
PRECONNECT: Two connections are established when the client logs in to the database. A login to database will create two connection at the same time. For this to work, clusterware actually starts two services. One main service and another shadow service.

TAF can be configured at the Oracle Client side in tnsnames.ora or at the Database Server side using the SRVCTL utility.  Configuring it at the server is preferred.. This article covers the configuration at the server using SRVCTL.

  1. Create service using SRVCTL
$ srvctl add service -d BKISDB -s HR -r BKISDB1,BKISDB2 -P BASIC -e SELECT

  1. Start service using SRVCTL
$ srvctl start service -d BKISDB -s HR

  1. Create new tns entry for HR service:
HR =
 (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = scan)(PORT = 1521))
    (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = HR)
    )
 )

  1. Test new service:
$ sqlplus system/password@HR


I hope this helps.

Please feel free to leave your questions or suggest improvements to this section.

1 comment: