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

Home -> Community -> Usenet -> c.d.o.misc -> Re: continuously check whether Db is up

Re: continuously check whether Db is up

From: Connor McDonald <mcdonald.connor.cs_at_bhp.com.au>
Date: Sun, 22 Nov 1998 14:23:14 +0800
Message-ID: <3657ADD2.133@bhp.com.au>


pradeepj_at_delhi.tcs.co.in wrote:
>
> Hi! In my application which I am writing in 'C' and pro*C, I want to
> continuously check whether an instance of oracle database is up or not. This
> I can do by connecting to the database(using EXEC SQL CONNECT)after certain
> fixed interval of time but this seems to me very time consuming method.
>
> is there any other way like what tns ping would be doing internally.
>
> I do not want to use tnsping in my program as it is shell command.
>
> thanks in advance
>
> -pradeep
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Why not just recover from the database "not" being there...

Your C app continues on its merry way until an SQL statement gives a shutdown in progress error (ie you could trap for errors:

ORA-01089: immediate shutdown in progress - operations are permitted or
ORA-03114: not connected to ORACLE

If you pgm needs to be "recoverable", at this point you enter the   loop until some threshold
    try reconnect
    if ok then exit loop
    wait 30 seconds
  end loop

HTH --



Connor McDonald
BHP Information Technology
Perth, Western Australia
"The difference between me and a madman is that I am not mad" Received on Sun Nov 22 1998 - 00:23:14 CST

Original text of this message

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