Re: How to use tnsping programmatically

From: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Wed, 15 Apr 2009 11:37:48 +0200
Message-ID: <ec8c3$49e5aaec$524b9d64$6609_at_cache1.tilbu1.nb.home.nl>



Strange Cat _at_ Work wrote:
> Hello everyone,
>
> I'd like to know if it is possible to use tnsping programmatically in
> order to check if Oracle server is available... I've been asked not to
> continuosly try connection and disconnection in order to save
> network/system resources.
>
> I will be using DotNet 2.0SP1 but any clue is welcome.
>
> Thanx in advance
> Paolo

Suggest you have a look at timeouts on network level, and test for those in your code.

Particularly interesting could be:
- sqlnet.expire_time (in case you last a connection while a work) - sqlnet.inbound_connect_timeout (will generate ORA-12547 or ORA-12637)

    (and specify inbound_connect_timeout_listener on the server!) - sqlnet.recv_timeout, in combination with sqlnet.send_timeout

http://download-west.oracle.com/docs/cd/B19306_01/network.102/b14213/sqlnet.htm has more information

-- 

Regards,
Frank van Bortel
Received on Wed Apr 15 2009 - 04:37:48 CDT

Original text of this message