Tuesday, January 8, 2013

Configure TAF


Configure  the server side failover parameters to the service:


srvctl add service -d car -s car-srv -r "car1,car2" -P BASIC --->10g

srvctl add service -d car -s car-srv -l PRIMARY -e SELECT -m BASIC -q TRUE -r car1,car2 -w 5 -z 180 -P BASIC --->11gR2

srvctl start service -d car -s car-srv

srvctl config service -d car

Configure Local_Listener and Remote_Listener parameters on db side.

Show parameter listener

Below statement only for 10g 

execute dbms_service.modify_service (service_name => 'car-srv' -
, aq_ha_notifications => true -
, failover_method => dbms_service.failover_method_basic -
, failover_type => dbms_service.failover_type_select -
, failover_retries => 180 -
, failover_delay => 5 -
, clb_goal => dbms_service.clb_goal_long);

Verify status:

select name, failover_method, failover_type, failover_retries,goal, clb_goal,aq_ha_notifications
from dba_services where service_id = 3

NAME METHOD TYPE RETRIES GOAL CLB_GOAL AQNOT
------ ----------- ---------- -------- ---------- -------- -----
car-srv BASIC SELECT 180 NONE LONG YES

Check Listener services:

lsnrctl services


Client side connect time failover :

This is done by tnsentry.Don't need update on db level.

CAR=
 (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = vm1-vip.domain.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = vm2.vip.domain.com)(PORT = 1521))
     )
    (LOAD_BALANCE=YES)
    (CONNECT_DATA =
      (SERVICE_NAME = car-srv)
      (FAILOVER_MODE =
       (TYPE=SELECT)
       (METHOD=BASIC)
      )
    )
  )

Virtual IP:

VIP address is public ip because it's attached with public ip interface. VIP is managd by oracle clusterware.
We should use vip instead of public ip .Because vip is doing Fast Failover.Private IP  won't visible from outside of server and it should not be used.

For ex: If we will public ip address and one of the rac node will be crased then the client will make a request to the node on the public IP and will wait for a TCP timeout (usually 60 seconds) before moving to the next host in the connection list.

If we will user vip ,the client does not have to wait for a TCP timeout to move to the next node in the connection list



Failover Method:

BASIC               :session will not reconnect to a surviving node until the failover occurs.
PRECONNECT :shadow process will be  created on a backup instance to reduce failover time.

Failover Type:

SELECT : session will be authenticated on a surviving node but as well as SELECT statements will be re-executed
Session    :  In a SESSION failover, only the users session will be  re-authenticated.

11gR2 TAF Example:

TAF is a client side features that allows clients to reconnect on surviving node in the event of failure on instance.Reconnect happens automatically from with in OCI library.
*Any uncommited transactions will be rolled back.
*Server side program variables and session properties will be lost
*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.

srvctl add service -d ten -s tenpp -q TRUE -P BASIC -j LONG -e SELECT -m BASIC -z 5 -w 5 -r ten1,ten2

Options:
-d  db_unique name
-s  Service name
-r  preferred instances
-a available instances.specify available instances if preferred instances are not specified
-g Serverpool name
-c uniform,singleton
-p failover method (None,Basic,Preconnect)
-e fileover type(Session,Select,None)
-y specify service startup (Manaul,Automatic)
-j connection load balancing goal(Short,Long)
-B enable or disable load balancing advisory(none,service_time,throughput)
-m Failover method optin(none,basic)
-z specify number of times to attempt to connect after a failover (default 5 attempts)
-w Specify the amount of time in seconds to wait between connect attempts (default 1 sec)



[oracle@vm12 ~]$ srvctl config service -d ten -s tenpp
Service name: tenpp
Service is enabled
Server pool: ten_tenpp
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: true
Failover type: SELECT
Failover method: BASIC
TAF failover retries: 5
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: ten1,ten2
Available instances:




 

No comments: