Hello,
In this post we will create TAF (Transparent Application Failover) Services as such pre-11gr2 method that is available and preferred instances way.
Environment:-
1. 4 Node RAC, rac01,rac02,rac03,rac04 running orcl database and its instances.
2. A service server_taf is created, for which orcl1 is available instance and orcl2 is the preferred instance.
TAF Setup & Testing:-
1. Create Service
srvctl add service -d orcl -s server_taf –r orcl1 –a orcl2 -P BASIC
2. Start the service
srvctl start service -d rac -s server_taf
3. Check the services
srvctl config service -d rac
3. Modify the service to have load balancing options (optional)
SQL> execute dbms_service.modify_service (service_name => 'server_taf' -
, 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);
4. Keep tns entries in both client and server side (on all nodes too)
SERVERTAF =
(DESCRIPTION =
(LOAD_BALANCE = yes)(ADDRESS = (PROTOCOL = TCP)(HOST = scan.localdomain)(PORT = 1521))
(CONNECT_DATA =(SERVICE_NAME = server_taf.localdomain)
(FAILOVER_MODE= (TYPE=select)(METHOD=method)
)
5. Check the configuration
All the screenshot has been sent by Deepak kumar from his test server, Much thanks to him for his time and effort and permitted us to upload for all benefit
6. Check the Service run state, server_taf is running on orcl1
7. Test the TAF Service
sqlplus system/manager@server_taf
check in the node with following query where is the session and failover mode status
SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)
FROM V$SESSION
GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER;
8. Run a very big query in the session you have connected
SQL> Select * from dba_objects;
This will run approx 5-10 mins in my test machine
9. Kill the pmon at OS level to simulate crash on Node 1 and apparently service should failover to the available node, and also the workload i.e the above dba_objects query rather the session disconnection and disruption
And you may also observe the session in orcl1 (node1) is still running as such.
10. Start the instance orcl1 on node 1 and relocate the services back to orcl1 from orcl2
11. Check the configuration
In Next post we will see to create a server pools and then add this service to serverpool. Basically in this method, the services are bounded to instances , available node and preferred node, but in serverpools concept the services bound to nodes anywhere.
-Thanks
Follow Me!!!