Re: How to use tnsping programmatically

From: Mark D Powell <>
Date: Wed, 8 Apr 2009 05:57:28 -0700 (PDT)
Message-ID: <>

On Apr 8, 4:35 am, "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

You can call tnsping from a shell script or a program, but how often are you planning on running this check?

How often were you running your last check that managment or the network team asked you not to run?

There is generally no real need to continuously check to see if the database is there. If the database is not there you will know in fairly short order when the phone calls start coming in. From within an application you can just check the return code on the connect call. If the connect fails you will get an error code and you can pass this on to an alert system (feature) to provide the database down/ unreachable error information.

HTH -- Mark D Powell -- Received on Wed Apr 08 2009 - 07:57:28 CDT

Original text of this message