f



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

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.

0
4/4/2007 4:56:11 AM
comp.lang.java.databases 3049 articles. 0 followers. samyaksulabh (16) is leader. Post Follow

4 Replies
1121 Views

Similar Articles

[PageSpeed] 48

On Apr 3, 9:56 pm, harishas...@gmail.com wrote:
> 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.

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

0
joeNOSPAM
4/4/2007 5:50:41 PM
On Apr 4, 10:50 am, "joeNOS...@BEA.com" <joe.weinst...@gmail.com>
wrote:
> On Apr 3, 9:56 pm, harishas...@gmail.com wrote:
>
> > 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.
>
> 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

0
joeNOSPAM
4/4/2007 5:54:38 PM
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!

0
harishashim
4/12/2007 7:13:22 AM
This is a multi-part message in MIME format.
--------------040909050201060907020502
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

harishashim@gmail.com wrote:
> 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!
> 

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

--------------040909050201060907020502
Content-Type: text/x-vcard; charset=utf-8;
 name="rroberts_pub1.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="rroberts_pub1.vcf"

begin:vcard
fn:Rick Roberts
n:Roberts;Rick
email;internet:rroberts_pub1@verizon.net
version:2.1
end:vcard


--------------040909050201060907020502--
0
Rick
5/31/2007 6:30:36 PM
Reply: