TNSPING a database [message #67658] |
Mon, 13 December 2004 11:09 |
Kevin Darden
Messages: 6 Registered: July 2004
|
Junior Member |
|
|
Is there anyway you can use TNSPING to find out if a database is available? I think TNSPING only tells you if the Listener is running, but I would like to account for an active Listener and a shutdown database. And I would like to do it in the operating system environment, not SQL Plus. Thanks in advance for any help.
|
|
|
|
Re: TNSPING a database [message #67688 is a reply to message #67658] |
Mon, 10 January 2005 02:00 |
Michael Hartley
Messages: 110 Registered: December 2004 Location: West Yorkshire, United Ki...
|
Senior Member |
|
|
Hi,
You can use sqlplus to test the reachability and availability of a database by analyzing the ORA-XXXXX error codes.
For example, if I want to confirm database B is available I attempt to log onto the database using a bogus or invalid username and analyze the ORA-XXXXX error codes. If you plan to test a lot of databases during a single Ping session, then choose a username that is very unlikely to occur naturally within your environment.
eg.
sqlplus x123/y123@B
If the database is up and authenticating the following should be returned:
ORA-01017: invalid username/password; logon denied
If the listener is up but the database down the following should be returned:
ORA-01034: ORACLE not available
If you are interested in any other outcomes, following the same methodology.
Michael Hartley
Openfield Solutions Ltd
www.openfieldsolutions.co.uk
|
|
|