Oracle RAC - Configuring TAF


To set up TAF, create a service on the cluster :
    [oracle@racgo1 ~]$  srvctl add service -db dev -service TES_TAF -preferred "dev1,dev2" -tafpolicy BASIC

Start the created service :
    [oracle@racgo1 ~]$ srvctl start service -db dev -service TES_TAF
    Check that the service is running
    [oracle@racgo1 ~]$ srvctl config service -db dev
    Service name: TES_TAF
    Server pool: 
    Cardinality: 2
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: false
    Global: false
    Commit Outcome: false
    Failover type: 
    Failover method: 
    Failover retries: 
    Failover delay: 
    Failover restore: NONE
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition: 
    Pluggable database name: 
    Hub service: 
    Maximum lag time: ANY
    SQL Translation Profile: 
    Retention: 86400 seconds
    Replay Initiation Time: 300 seconds
    Drain timeout: 
    Stop option: 
    Session State Consistency: DYNAMIC
    GSM Flags: 0
    Service is enabled
    Preferred instances: dev1,dev2
    Available instances: 
    CSS critical: no
    Service uses Java: false

Now you can modify the service according to your needs, for example :
    oracle@racgo1 ~]$ srvctl modify service -db dev -service TES_TAF -failovermethod BASIC 
                                    -failovertype SELECT -notification TRUE -clbgoal LONG

    [oracle@racgo1 ~]$ srvctl config service -db dev
    Service name: TES_TAF
    Server pool: 
    Cardinality: 2
    Service role: PRIMARY
    Management policy: AUTOMATIC
    DTP transaction: false
    AQ HA notifications: true
    Global: false
    Commit Outcome: false
    Failover type: SELECT
    Failover method: BASIC
    Failover retries: 
    Failover delay: 
    Failover restore: NONE
    Connection Load Balancing Goal: LONG
    Runtime Load Balancing Goal: NONE
    TAF policy specification: BASIC
    Edition: 
    Pluggable database name: 
    Hub service: 
    Maximum lag time: ANY
    SQL Translation Profile: 
    Retention: 86400 seconds
    Replay Initiation Time: 300 seconds
    Drain timeout: 
    Stop option: 
    Session State Consistency: DYNAMIC
    GSM Flags: 0
    Service is enabled
    Preferred instances: dev1,dev2
    Available instances: 
    CSS critical: no
    Service uses Java: false

Test TAF via SQL*Plus :
Since SQL*Plus is a native Oracle Call Interface (OCI) client and does not require additional settings to support TAF, it is advised to test TAF using SQL*Plus.

Create the connection string for the service :
    TES_TAF=
        (DESCRIPTION=
            (TRANSPORT_CONNECT_TIMEOUT=3) (RETRY_COUNT=6)
            (ADDRESS= (PROTOCOL=tcp) (HOST = racgo-scan ) (PORT=1521))
            (CONNECT_DATA =
                (SERVER = DEDICATED)
                (SERVICE_NAME = TES_TAF)
            )
        )
Test the failover by connecting through the service, then stopping the instance where we got connected first and verify the failover working
    [oracle@racgo1 admin]$ sqlplus tes/tes@TES_TAF

    SQL*Plus: Release 19.0.0.0.0 - Production on Tue May 14 18:11:32 2024
    Version 19.3.0.0.0

    Copyright (c) 1982, 2019, Oracle.  All rights reserved.

    Last Successful login time: Thu May 02 2024 17:11:26 +05:30

    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.3.0.0.0

    SQL>  select host_name,instance_name from v$instance;

    HOST_NAME
    ----------------------------------------------------------------
    INSTANCE_NAME
    ----------------
    racgo2.localdomain
    dev2

    SQL> select failover_type, failover_method, failed_over from v$session 
                                    where sid=sys_context('userenv', 'sid');

    FAILOVER_TYPE FAILOVER_M FAI
    ------------- ---------- ---
    SELECT	      BASIC	 YES



( Oracle Database - Space & Storage Parameters)