Writing About Our Experiences With Oracle Databases
Friday September 3rd 2010

Latest Topics

Effect Of Multiple SHMMAX Settings

Last week I saw a warning message at database startup time saying: WARNING: EINVAL creating segment of size [Read More]

Finding blogging tough? Just copy and do find and replace

Finding blogging tough? Just copy and do find and replace

Well this is motto followed by Guenadi Jilevski for his blog http://gjilevski.wordpress.com and he seems to get result [Read More]

Physical Corruption: ORA-1578 part 3

Recently we encountered a block corruption issue in 10g database on Linux x86 64 bit and using ASM for storing database [Read More]

Cloning RAC Database with RMAN fails with error

Steps for cloning a RAC database  with RMAN is similar to cloning a single instance database. But while using rman [Read More]

DBMS_SCHEDULER jobs not running?

I came across this posting on OTN which lists down things to check in case your scheduler job is not . This is quite [Read More]

Transparent Application Failover – TAF

Transparent Application Failover (TAF) is a client-side feature that allows for clients to reconnect to surviving databases in the event of a failure of a database instance.

Note that this is not used for purpose of load balancing or for Connect Time Failover.

 

TAF operates in two modes

 - Session Failover which will recreate lost connections and sessions

- Select Failover which will replay queries that were in progress. It will discard the old rows which have been fetched earlier and will fetch the rest of rows.

 TAF can be implemented at

 - Client Side

- Server Side

 Client Side

 This can be done by creating a entry in tnsnames.ora as follows

 

TESTDB10_basic=
(DESCRIPTION=
(LOAD_BALANCE=on)
 (FAILOVER=on) 
(ADDRESS= (PROTOCOL=tcp) HOST=prod01-vip)(PORT=1521))
(ADDRESS= (PROTOCOL=tcp)(HOST= prod02-vip)PORT=1521))
(CONNECT_DATA=
 (SERVICE_NAME=TESTDB10)
(FAILOVER_MODE= (TYPE=select)
(METHOD=basic))))

Here FAILOVER_MODE parameter is used to implement TAF.

Above configuration is for connections which will allow new connections to be created at failover time. This is determined by parameter METHOD which is set to BASIC here.

You can also have a session established before. This helps as new connection can take time and will thus result in faster failover. To do this use

TESTDB_prod01=
(DESCRIPTION=
(LOAD_BALANCE=on)
(FAILOVER=on)
(ADDRESS= (PROTOCOL=tcp) HOST=prod01-vip)(PORT=1521))
(CONNECT_DATA=
(SERVICE_NAME=TESTDB)
(INSTANCE_NAME=TESTDB1)
(FAILOVER_MODE= (BACKUP= TESTDB_prod02)
(TYPE=select) (METHOD=PRECONNECT))))

 TESTDB_prod02=
(DESCRIPTION=
(LOAD_BALANCE=on)
 (FAILOVER=on)
 (ADDRESS= (PROTOCOL=tcp) HOST=prod01-vip)(PORT=1521))
 (CONNECT_DATA=
 (SERVICE_NAME=TESTDB10)
(INSTANCE_NAME=TESTDB2)
 (FAILOVER_MODE=
 (BACKUP= TESTDB_prod01)
(TYPE=select)
(METHOD=PRECONNECT))))

Following query can be used to monitor information about failed over sessions

SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)
FROM V$SESSION GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER;

Server Side Configuration

 

This can be done using server-side service attributes. Please note that in case both (Client side and server side) configuration are used then service-side settings will be used.

 

You can refer to following note for details

 

Note 404644.1 – Configuration of Transparent Application Failover(TAF) works with server side service

Features of TAF

 - Sessions executing any insert/update/delete statement fail then statement will be rollback.

- A command which has been successfully completed upon failure and has changed the database state, then TAF does not resend the command.

- When using select failover, we will retrieve only the rows which have not been fetched by earlier sessions.

  • Share/Bookmark
Related Tags: , ,

5 Comments for “Transparent Application Failover – TAF”

  • rommel says:

    Hi

    Some of my application are coded in Pro*c .We are using Oracle 10g.i would liek know how tomake the application grid aware. Ie how to switch over to another instance running aon another node provided orginal one fails in execution.

  • Amit says:

    Rommel,

    I have never done Pro*c coding so not aware about how to do it. I did a search on metalink and found Note 415245.1 with a sample code to implement the same. You can refer to the before mentioned note.

    Cheers
    Amit

  • rommel says:

    Hi Amith,

    thanks for the info

    actually could yopu send me the link. couldn’t get what u have mentioned

    sonythomas@hotmail.com

    • Amit says:

      Actually above mentioned note is available on metalink and is published and can be viewed by all metalink users. I can’t provide the link as you need to have metalink account to view this article.

  • rommel says:

    Thanks a lot Amit, The metalink contained what i was looking for :-)


Leave a Comment

Recent Comments

Ron Gordon had this to say

I had a simillar ORA-15020: discovered duplicate ASM disk issue, our sysadmin determined that there was a BAD Read the post

Can a security group be a member of another group? had this to say

install Oracle and have so many problems with it. My goal is to install it according to this link Read the post

M Tanvir had this to say

Hi Amit, really its great response, bcoz i just new with oracle. Thanks... Read the post

Aman.... had this to say

Hahaha aur sab se badi baat, he is not even ready to accept! jigar chahiye bhai yeh karne aur fir na maanne ke liye :D . Read the post

Dev had this to say

Hi Amit, Thanks for quick reply. It looks fine on my HTC Desire ( Android ) ,so no need to worry about Read the post