Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to check whether DB is up
[This followup was posted to comp.databases.oracle.server and a copy was
sent to pradeepj_at_delhi.tcs.co.in if this address didn't require editing.]
In article <7362t0$ejd$1_at_nnrp1.dejanews.com>, pradeepj_at_delhi.tcs.co.in
says...
> 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
>
Actually, I believe, tnsping will only tell you that the listener is up, not the data base instance. Why can't you simply connect and execute a procedure that sleeps forever? If the data base goes down you'll receive and error. Of course the listener could go down, which to users trying to connect would be the same thing as the data base being down, and you wouldn't detect it.
Maybe you should remain connected, sleep for a while, wake up and run both a tnsping and execute a stored proc that is your own "ping". You don't need to execute the tnsping process, there are TNS API functions you can call.
Regards,
Bob
--
Bob Withers Do or do not, there is no try bwit_at_pobox.com Yoda -------------------------------------------------------------------------Received on Sat Nov 21 1998 - 06:04:45 CST
![]() |
![]() |