Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to check whether DB is up
For UNIX, you can use an Oracle executable called "oiconnect". Here is a
little script to show it how it works:
ORACLE_SID=<sid>;export <sid>;
if oiconnect <username>/<password>
then
echo "database is up and running"
else
echo "database is down, please contact the DBA"
fi
you can modify it so that it will run every half an hour and send the result to you through email.
HTH Winnie
In article <3658c8b9.5626159_at_192.86.155.100>,
tkyte_at_us.oracle.com wrote:
> A copy of this was sent to pradeepj_at_delhi.tcs.co.in
> (if that email address didn't require changing)
> On Sat, 21 Nov 1998 09:58:59 GMT, you 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.
> >
>
> tnsping only checks for the existence of the sqlnet listener -- no database
need
> be running for tnsping to succeed.
>
> If you connect to the database once in your application and stay connected, an
> occasional "select sysdate from dual" will do it for you -- if it works,
> database is up, if not -- database is not up.
>
> >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
>
> Thomas Kyte
> tkyte_at_us.oracle.com
> Oracle Government
> Herndon VA
>
> --
> http://govt.us.oracle.com/ -- downloadable utilities
>
> ----------------------------------------------------------------------------
> Opinions are mine and do not necessarily reflect those of Oracle Corporation
>
> Anti-Anti Spam Msg: if you want an answer emailed to you,
> you have to make it easy to get email to you. Any bounced
> email will be treated the same way i treat SPAM-- I delete it.
>
-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Mon Nov 23 1998 - 11:22:51 CST