The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX and Linux Applications
Google UNIX.COM


UNIX and Linux Applications Questions involving software not covered by other forum go here. This includes Databases and Middleware.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to reconnect to online database? vanitham High Level Programming 1 10-27-2007 06:29 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-14-2007
Registered User
 

Join Date: Aug 2007
Posts: 1
DataBase Online Or Not

Hey every one,

I am new here, and work as DBA ,can I ask if there any tools can installed or command help me to know if the current DB still connected or not ? The DB that work on is so disturbing, your response are highly appreciated,

Note : DB is Oracle and the OS is certain Unix.


Best Regards
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-14-2007
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
I'm a sysadmin, not a DBA (we have our own Oracle DBAs in house), but I know that you can use the lsnrctl command to show if the listeners are active

Code:
$ORACLE_HOME/bin/lsnrctl status
Cheers
ZB
Reply With Quote
  #3 (permalink)  
Old 08-14-2007
robotronic's Avatar
Can I play with madness?
 

Join Date: Apr 2002
Location: Italy
Posts: 370
Testing if "the current DB still connected or not" doesn't really mean anything. I think you need to know "if the database is open", and so if user's connections are allowed. For that, you can run this simple script on the Oracle server machine:

Code:
USER="myuser"
PASS="mypassword"
$ORACLE_HOME/bin/sqlplus -s ${USER}/${PASS} <<EOF >/dev/null 2>&1
whenever oserror exit 98;
whenever sqlerror exit 99;
exit 140;
EOF

if [ "$?" -ne 140 ]
then
   echo "Oracle is down!"
else
   echo "Oracle is up."
fi
Of course, you can try to run this also on a client machine, although the result will be inaccurate: you may not be able to connect to the database for other problems (i.e. listener down) but the database on the server is up & running.

Hope this helps

Last edited by robotronic; 08-22-2007 at 09:57 AM.
Reply With Quote
  #4 (permalink)  
Old 07-21-2008
Registered User
 

Join Date: Jul 2008
Posts: 19
hi,

you can aslo use the commande:

# ps - ef | grep ora

just to see if all process are up or not.

Not: this can be used as first in order to know if the process which are handling oracle are Up or Not.

Thx.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0