Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Best way to check oracle database server / services is alive using Java

37 views
Skip to first unread message

haris...@gmail.com

unread,
Apr 4, 2007, 12:56:11 AM4/4/07
to
Hi,

I am looking for the best way to check whether several oracle (or any
database) databases is running or not.

At the moment I just attempt to connect to the server IP using Socket
and conclude the database is not running if connection timed out.

Which is a silly way of doing it.

Appreciate any help.

Best regards.

joe.we...@gmail.com

unread,
Apr 4, 2007, 1:50:41 PM4/4/07
to

It's not silly, it's elementary. That's as good as you can do
generically,
in that it's quick, and if you can't get a socket to the DBMS
listener,
your JDBC driver won't either (as long as the driver is also using
TCPIP)
to connect) but not completely reliable, because the DBMS listener may
be
up, but the DBMS may still not be in an operating condition.

Joe Weinstein at BEA Systems

joe.we...@gmail.com

unread,
Apr 4, 2007, 1:54:38 PM4/4/07
to
On Apr 4, 10:50 am, "joeNOS...@BEA.com" <joe.weinst...@gmail.com>
wrote:

And another problem (with no solution) is that a DBMS
might have a limit on the number of concurrent
connections, so a new socket request may be rejected,
but all currently existing connections may be operating
as expected.... Just to say the real answer to the general
question may not be trivial to get. In fact, if the
conditions are dynamic, whatever test you make may
pass, but the DBMS or environment may change in between
your running your test and your acting on the results.
Good luck,
Joe

haris...@gmail.com

unread,
Apr 12, 2007, 3:13:22 AM4/12/07
to
On Apr 5, 1:54 am, "joeNOS...@BEA.com" <joe.weinst...@gmail.com>
wrote:

> And another problem (with no solution) is that a DBMS
> might have a limit on the number of concurrent
> connections, so a new socket request may be rejected,
> but all currently existing connections may be operating
> as expected.... Just to say the real answer to the general
> question may not be trivial to get. In fact, if the
> conditions are dynamic, whatever test you make may
> pass, but the DBMS or environment may change in between
> your running your test and your acting on the results.
> Good luck,
> Joe

Thanks! I am still waiting for a way to test.

As an addition the least I can do is connect to the database and do a
SELECT statement. And set a background cron job to do this every 10
minutes?

Unless there is a better way of doing this? For instance if there is a
ARE YOU ALIVE statement that I can execute.

warm regards!

Rick Roberts

unread,
May 31, 2007, 2:30:36 PM5/31/07
to
rroberts_pub1.vcf
0 new messages