Transparent Application Failover (TAF) Service in Oracle RAC 11gR2

ADDING TAF SERVICE FOR SCAN
_____________________________
####### As “Oracle” (owner of database) user
test – name of database
test1- instance on node1
test2- instance on node2
testscan- name for the new taf service
srvctl add service -d test -s testscan -r “test1,test2” -P BASIC
srvctl start service -d test -s testscan
srvctl config service -d test
SQL> select name,service_id from dba_services where name = ‘testscan’;
SQL> select name, failover_method, failover_type, failover_retries,goal,
clb_goal,aq_ha_notifications from dba_services where service_id = 3;
SQL> execute dbms_service.modify_service (service_name => ‘testscan’ –
, 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);
lsnrctl status
lsnrctl status LISTENER_SCAN1
lsnrctl status LISTENER_SCAN2
lsnrctl status LISTENER_SCAN3
————————————————————
TESTING THE TAF USING SCAN
In your client tnsnames.ora file add below entry after creating TAF service above :
testSCAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testscan.domain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = testscan)
(FAILOVER_MODE=
(TYPE=select)
(METHOD=basic))))
sqlplus system/system@testrac
You can verify the client connections to 11gR2 database for TAF using –
SQL> SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)
FROM V$SESSION
GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER;
MACHINE AILOVER_TYPE FAILOVER_M FAI COUNT(*)
——— ————- ——— —– —
mymachine SELECT BASIC NO 1
SQL> select count(*) from table;
# You can continously run this query and mean while go to the cluter node and down the service on node2 and the instance also on node 2
LOGON TO CLUSTER NODE1 as “grid” user:
srvctl stop service -d test -n testracnode2
srvctl stop instance -d test -n testracnode2
crsctl stat res -t
And when you go back to your client connection. You can see that the query is still executing without the connection being lost.
SQL> SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)
FROM V$SESSION
GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER;
Don;t forget to start the service again :))
srvctl start instance -d test -n testracnode2
srvctl start service -d test -n testracnode2
_______________________________________________
###########SRVCTL COMMAND TO ADD SERVICE FOR TAF
srvctl add service -d test -s testscan -r “test1,test2” -P BASIC -m BASIC -z 180 -w 5 -j LONG -q TRUE -e SESSION
-d database unique name
-s name of the service to be created
-r preferred instances where the service would run
-P Basic or Preconnect method of connection, PRECONNECT establishes a backup connection on another ndoe, whereas BASIC does a session failover
-z failover retries
-w failover delay
-j session type. either a long session or short session, LONG or SHORT
-q Send Oracle Advanced Queuing (AQ) HA notifications. For standalone servers, applicable in Oracle Data Guard environments only
-e Session Select or None. Use sess
### Command to check serrvice status ####
srvctl config service -d test -s testscan -a
Warning:-a option has been deprecated and will be ignored.
Service name: testscan
Service is enabled
Server pool: test_testscan
Cardinality: 2
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: true
Failover type: SESSION
Failover method: NONE
TAF failover retries: 180
TAF failover delay: 5
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: test1,test2
Available instances:

Category: Database

Tags:

Leave a Reply

Article by: Shadab Mohammad