The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > UNIX and Linux Applications
.
google unix.com



UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

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 10:29 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-14-2007
molanfx molanfx is offline
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
  #2 (permalink)  
Old 08-14-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
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
  #3 (permalink)  
Old 08-14-2007
robotronic's Avatar
robotronic robotronic is offline Forum Advisor  
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 01:57 PM..
  #4 (permalink)  
Old 07-21-2008
vitchi vitchi is offline
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.
  #5 (permalink)  
Old 09-26-2008
Reboot's Avatar
Reboot Reboot is offline
Registered User
  
 

Join Date: Sep 2008
Location: Asia Pecific.
Posts: 31
Hiii...
I am also System Admin, but usually we take offline backup by taking database and Applications offline and we do something like this:

We use following command :
#ps -ef | grep pmon | grep -v grep #Check pmon process.

and if this shows some output, that means Database is online, else it is offline.....


To make database offline,we do following :

1. Get sql prompt :
#sqlplus "/as sysdba"
2. Shut down database:
SQL> shutdown immediate

3. Exit from sql prompt :
SQL> quit


And then again check "pmon" process.

Hope this will help you...

Cheers...

Last edited by Reboot; 10-04-2008 at 05:07 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0