Forgot your password?    
+ Reply to Thread
Results 1 to 2 of 2

Thread: Transparent Application Failover (TAF) Setup on Client Side for Oracle RAC

  1. #1
    Expert Oracle Administrator
    Join Date
    Oct 2011
    Location
    New Delhi, India
    Posts
    427

    Transparent Application Failover (TAF) Setup on Client Side for Oracle RAC

    Transparent Application Failover (TAF) is a client-side feature that allows for clients to reconnect to surviving nodes in the event of a failure of an instance. The reconnect happens automatically from within the OCI (Oracle Call Interface) library.

    Uncommitted transactions : are rolled back and server side program variables and session properties will be lost.
    In some case the select statements automatically re-executed on the new connection with the cursor positioned on the row on which it was positioned prior to the failover.

    For high availability and scalability, Oracle provides the Transparent Application Failover feature part of Oracle Real Application Clusters (RAC).

    The failover is configured in tnsnames.ora file, the TAF settings are placed in CONNECT_DATA section of the tnsnames.ora using FAILOVER_MODES parameters.

    TYPE: TAF supports three types of failover types

    1.SESSION failover - If a user's connection is lost, SESSION failover establishes a new session automatically created for the user on the backup node. This type of failover does not attempt to recover selects. This failover is ideal for OLTP (online transaction processing) systems, where transactions are small.

    2.SELECT failover – If the connection is lost, Oracle Net establishes a connection to another node and re-executes the SELECT statements with cursor positioned on the row on which it was positioned prior to the failover. This mode involves overhead on the client side and Oracle NET keeps track of SELECT statements. This approach is best for data warehouse systems, where the transactions are big and complex

    3.NONE: This setting is the default and no failover functionality is provided. Use this setting to prevent failover.

    Example for Failover :

    DEVDB =
    (DESCRIPTION =
    (LOAD_BALANCE = ON)
    (FAILOVER = ON)
    (ADDRESS = (PROTOCOL = TCP)(HOST = RAC1-VIP)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = RAC2-VIP)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = DEVDB.dbalounge.com)
    (FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 10)(DELAY = 5))
    )
    )

    METHOD: This parameters determines how failover occurs from the primary node to the backup node

    BASIC: Use this mode to establish connections at failover time, no work on the backup server until failover time.

    PRECONNECT: Use this mode to pre-established connections. This PRECONNECT mode provides faster failover but requires that the backup instance be capable of supporting all connections from every supported instance.

    RETRIES: Use this parameter to specify number of times to attempt to connect to attain a failover. If DELAY is specified but RETRIES is not specified, RETRIES default to five retry attempts.

    DELAY: Use this parameter to Specify the amount of time in seconds to wait between connect attempts. If RETRIES is specified but DELAY is not specified, DELAY default to one second.

    Example:

    DEVDB1 =
    (DESCRIPTION =
    (LOAD_BALANCE = ON)
    (FAILOVER = ON)
    (ADDRESS = (PROTOCOL = TCP)(HOST = RAC1-VIP)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = RAC2-VIP)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = DEVDB.dbalounge.com)
    (FAILOVER_MODE = (TYPE = SELECT)(METHOD = BASIC)(RETRIES = 10)(DELAY = 5))
    )
    )

    Please note that you can pre-establish a connection to reduce the failover time using METHOD=PRECONNECT option.

    To verify that TAF is correctly configured, you query FAILOVER_TYPE, FAILOVER_METHOD, and FAILED_OVER columns in the V$SESSION view.

    SQL> SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER FROM GV$SESSION

    EXAMPLE :
    =========

    SQL> SELECT inst_id,sid,username,FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER FROM GV$SESSION where FAILOVER_TYPE!='NONE'
    /

    INST_ID SID USERNAME FAILOVER_TYPE FAILOVER_M FAI
    ---------- ---------- ------------------------------ ------------- ---------- ---
    1 128 SHAILESH SELECT BASIC NO
    1 137 SANDEEP SELECT BASIC NO
    1 138 PUSHKAR SELECT BASIC NO
    2 130 MUKESH SELECT BASIC NO
    2 133 SANDEEP SELECT BASIC NO
    2 135 RAJ SELECT BASIC NO
    2 137 VIKAS SELECT BASIC NO

    8 rows selected.

    Shutdown instance 1.

    SQL> shut immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL>

    SQL> /

    INST_ID SID USERNAME FAILOVER_TYPE FAILOVER_M FAI
    ---------- ---------- ------------------------------ ------------- ---------- ---
    2 127 SANDEEP SELECT BASIC YES
    2 129 PUSHKAR SELECT BASIC YES
    2 130 MUKESH SELECT BASIC NO
    2 132 SHAILESH SELECT BASIC YES
    2 133 SANDEEP SELECT BASIC NO
    2 135 RAJ SELECT BASIC NO
    2 137 VIKAS SELECT BASIC NO

    7 rows selected.

  2. #2
    Oracle DBA
    Join Date
    Sep 2012
    Posts
    1

    TNS entry for 11g R2 database with TAF entry

    orcl =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-cluster-scan)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl.example.com)
    (FAILOVER_MODE= (TYPE=select)(METHOD=basic)(RETRIES=10)(DELAY=5))
    )
    )

+ Reply to Thread

Similar Threads

  1. Oracle RAC 11gR2 Server Side TAF Using SRVCTL.
    By ajaychandi in forum RAC Performance,LoadBalancing,TAF,FAN,Troubleshooting
    Replies: 1
    Last Post: 11-15-2012, 06:46 PM
  2. Oracle RAC 11gR2 Client Side TAF.
    By ajaychandi in forum RAC Performance,LoadBalancing,TAF,FAN,Troubleshooting
    Replies: 0
    Last Post: 09-24-2012, 08:45 AM
  3. Transparent Application Failover (TAF) setup and testing - Oracle 10g RAC
    By devesh_ocp in forum RAC Installation, ASM Install , ASM Administration
    Replies: 1
    Last Post: 04-24-2012, 05:40 PM
  4. Oracle 10g Dataguard Failover.
    By ajaychandi in forum DataGuard Setup and Management
    Replies: 0
    Last Post: 01-18-2012, 11:46 PM
  5. Server-side Transparent Application Failover (TAF) in Oracle RAC
    By Hemant in forum RAC Performance,LoadBalancing,TAF,FAN,Troubleshooting
    Replies: 0
    Last Post: 12-15-2011, 03:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

DBA Lounge (P) Ltd. deals in Oracle Technologies on Consulting, Resourcing, Corporate Training


Online and corporate training available on Oracle Database 11g, Oracle 11g Real Application Cluster (RAC), Oracle Applications 11i/R12, Oracle Fusion Middleware 11g, Oracle Identity Management-OIM, Oracle Internet Directory 11g-OID, Oracle Business Intelligence Enterprise Edition-OBIEE, Oracle Golden Gate, Oracle Access Management-OAM, Oracle Internet Directory-ODS, Oracle Identity Analytics Architecture-OIA Statistics