Transparent Application Fail-over in Oracle RAC
Transparent Application Failover (TAF) is used for failover process, if the database instance connection goes fails it would reconnect to available database instance.
TAF can be configure in a 2 ways.
1.server Side
2. Client Side.
IN this Blog, we will configure server side TAF.
To configure TAF policy use SRVCTL as in the following example
srvctl service configuration syntax.
srvctl add service -d <db_unique_name> -s <service_name>
-r “” [-a “”] [-P {BASIC | NONE | PRECONNECT}]
-g [-c {UNIFORM | SINGLETON}]
[-k <net_num>]
[-l [PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]]
[-y {AUTOMATIC | MANUAL}]
[-q {TRUE|FALSE}]
[-x {TRUE|FALSE}]
[-j {SHORT|LONG}]
[-B {NONE|SERVICE_TIME|THROUGHPUT}]
[-e {NONE|SESSION|SELECT}]
[-m {NONE|BASIC}]
[-z <Failover_retries> ]
[-w <Failover_delay>]
Below are the description options for the above srvctl syntax.
-r “” [-a “”] [-P {BASIC | NONE | PRECONNECT}]
This clause is valid only for Administrator-managed database which support PRECONNECT method.
-g [-c {UNIFORM | SINGLETON}]
This clause is valid only for Policy-managed database where in PRECONNECT method is not available.
The above two options instruct clusterware on how to handle this service.
[-e {NONE|SESSION|SELECT}]
This defines the type of TAF whether SESSION or SELECT.
[-m {NONE|BASIC}]
This defines the method of TAF.
[-z ]
This defines the the number of times to attempt to connect after a failover.
[-w ]
This defines the amount of time in seconds to wait between connect attempts.
Steps to configure server side configuration.
1.Check Database status
oracle@DBGURU ~]$ srvctl status database -d DBGURU Instance DBGURU1 is running on node DBGURU Instance DBGURU2 is running on node DBGURU
2. Add service
[oracle@DBGURU ~]$ srvctl add service -d DBGURU -s DBGURU_test -r DBGURU1,DBGURU2 -P basic -e select -m basic -z 10 -w 5
3. service status
[oracle@DBGURU ~]$ srvctl status service -d DBGURU Service DBGURU_test is not running.
4. Start Service
[oracle@DBGURU ~]$ srvctl start service -d DBGURU -s DBGURU_test
5.Service status
[oracle@DBGURU ~]$ srvctl status service -d DBGURU Service DBGURU_test is running on instance(s) DBGURU1,DBGURU2
Add service into TNS entry on both node
DBGURU_test=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DBGURU-scan)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = DBGURU_test)
)
)
Below query to show failover status
select inst_id,username,service_name,failover_type,failover_method,failed_over from gv$session where username='DBGURU'
This document is only for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.
Hope so you like this article!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the latest update. Click here to know more about our pursuit.
1,222 total views, 1 views today
Hello and welcome to DBsGuru,
DBsGuru is a group of experienced DBA professionals and serves databases and its related community by providing technical blogs, projects, training.
Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.
Thanks for the visits!
Share Learn Grow!
Great article sir
Request to keep visiting us for new articles and provide your valuable feedback to motivate us & keep improving.
This information is very useful 🙂. Nicely explain about TAF. Thanks for sharing Informative information.