![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Questions involving software not covered by other forum go here. This includes Databases and Middleware. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to reconnect to online database? | vanitham | High Level Programming | 1 | 10-27-2007 06:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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 ZB |
|
#3
|
||||
|
||||
|
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
Hope this helps Last edited by robotronic; 08-22-2007 at 09:57 AM. |
|
#4
|
|||
|
|||
|
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
|
||||
|
||||
|
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 01:07 PM. |
||||
| Google The UNIX and Linux Forums |