Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: jdbc failover to standby question

Re: jdbc failover to standby question

From: Howard J. Rogers <hjr_at_dizwell.com>
Date: Thu, 06 May 2004 07:53:49 +1000
Message-ID: <40996264$0$20347$afc38c87@news.optusnet.com.au>


Sue wrote:

> I'm having a problem understanding how TAF to a standby database in
> jdbc would work. I currently have a production database with a
> standby database. I understand that I need to set some failover
> settings in the tnsnames.ora file and use the thick java jar files.
> What I don't understand is exactly how this would work.
>
> Suppose I have database on machine A and standby on machine B with TAF
> set up in the tnsnames files on both machines. Now suppose I have a
> jdbc app running on machine C. If machine A fails, how does my jdbc
> app access the tnsnames failover information? How does it know to go
> to machine C? Does this only work if machine A stays up with the
> listener running? Can anybody shed some light on how this works?

When you use the net configuration assistant to set up the fact that you have a tnsnames.ora to use for names resolution purposes, the assistant refers to that mechanism as "local", which kind of gives the game away. The tnsnames.ora file is supposed to be local, on the client. And if your server happens to be a client of another server (database links, for example, or archiving to a remote standby database in 8i or above) then the tnsnames.ora needs to be stored on the server as well. In either case, it is local to the machine making use of it to resolve service names... so in your scenario, machine C would have a copy, and would know how to locate a database on machine A or B with equal ease.

Secondly, I might have misunderstood your post, but I suspect you might be getting yourself a bit confused. TAF is called TAF because it stands for Transparent APPLICATION Failover. Not Transparent Server Failover. If A is a database, and B is a standby database, and A fails, then there is no way to transparently make B the new primary database. But if C is the client, and has been configured to use TAF, and is currently connected to A, the primary database, then when A fails, TAF means that the client will silently, automatically and transparently re-connect to B, the new primary. Your user will only notice a pause/stall/hang, whatever you want to call it, and then everything (well, pending select statements actually) magically just springs back into life.

In short, TAF has no relevance for the switchover to standby database, but has relevance only for your app on machine C, which would know what to do because its local tnsnames.ora tells it what to do.

Perhaps what you are really interested in, though, is how machine B can automatically become the new primary database in the event of failure at machine A?... to which the short answer is, it can't. You have to manually detect the problem, walk up to B and say 'activate standby database'.

If you're using Data Guard (ie, you also have 9i and above), it becomes easier to flip modes, but IIRC it's still not automatic. For truly automatic failover between servers, you'd have to implement RAC with Clusters Guard.

Regards
HJR Received on Wed May 05 2004 - 16:53:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US