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.
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
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
> 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!
There are *many* server monitor programs available.
Google for server monitor oracle
http://www.ipswitch.com/products/whatsup/index.asp
www.OpManager.com
http://www.hyperic.com/products/managed/managed.html?hqplug=lamj-management