Home » RDBMS Server » Networking and Gateways » TNSPING a database
TNSPING a database [message #67658] Mon, 13 December 2004 11:09 Go to next message
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 #67659 is a reply to message #67658] Tue, 14 December 2004 01:24 Go to previous messageGo to next message
Uwe
Messages: 260
Registered: February 2003
Location: Zürich, Switzerland
Senior Member
My be this script may help you

http://www.orafaq.com/scripts/unix/dbup.txt

rgds
Uwe
Re: TNSPING a database [message #67688 is a reply to message #67658] Mon, 10 January 2005 02:00 Go to previous message
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
Previous Topic: Can we make Exe using developer ?
Next Topic: Oracle 8i - Oracle 9i compatibility
Goto Forum:
  


Current Time: Wed May 01 06:15:46 CDT 2024