Re: How to use tnsping programmatically
- From: ddf <oratune@xxxxxxx>
- Date: Wed, 8 Apr 2009 11:27:10 -0700 (PDT)
Comments embedded.
On Apr 8, 8:43 am, "Strange Cat @ Work" <du...@xxxxxxxxx> wrote:
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.
Thanx for answering Mark,
the need is to avoid attempting the connection if the Oracle instance
appears to be unreachable.
Simply because you can tnsping the listener doesn't mean the database
is available.
We're developing a panel pc app that has to
connect to an Oracle server on demand (user touching screen and booking for
canteen).
Again, just because you can tnsping the listener does not guarantee
you can connect to the Oracle database, so your tnsping effort may
succeed only to have the users receive the following error:
ERROR:
ORA-12514: TNS:listener does not currently know of service requested
in connect descriptor
Or this error, if the database is hard-coded into the listener.ora
file:
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Problem is that the Oracle server happens to be on the other side of the
mountains (and this is for real, no joke) and we've been warned about lack
of connectivity/bandwidth on this connection.
Yes, the tnsping utility *can* prove you do have connectivity to the
server if the listener is up. If the listener is down you'll receive
an ORA-12541 error, which might indicate you can get to the server,
and it might not.
So, to make a long story short, what i'm trying to do is avoid connection
(and users waiting for a timeout to occur in front of pc) if Oracle is not
tnspingable...
Again I say that simply because tnsping returns error-free doesn't
mean your database is running or that a connection attempt will be
successful. Honestly I am not being negative, I am just trying to
provide a realistic view of this situation.
Other ideas are welcome, of course :)
HTH -- Mark D Powell --
Thanx again
Paolo
David Fitzjarrell
.
- References:
- How to use tnsping programmatically
- From: Strange Cat @ Work
- Re: How to use tnsping programmatically
- From: Mark D Powell
- Re: How to use tnsping programmatically
- From: Strange Cat @ Work
- How to use tnsping programmatically
- Prev by Date: Re: Subquery not returning results
- Next by Date: Re: How to use tnsping programmatically
- Previous by thread: Re: How to use tnsping programmatically
- Next by thread: Re: How to use tnsping programmatically
- Index(es):
Relevant Pages
|