Home » RDBMS Server » Server Administration » database is open or not
database is open or not [message #49805] Mon, 11 February 2002 04:17 Go to next message
satyajit vats
Messages: 3
Registered: February 2002
Junior Member
hi there,

can anybody help me to find out whether all of my databse are "OPEN" or not from unix o/s.

Thanx and Best Regards
Re: database is open or not [message #49807 is a reply to message #49805] Mon, 11 February 2002 05:14 Go to previous messageGo to next message
Daniel
Messages: 47
Registered: February 2000
Member
Try this: From a command prompt - type
ps -ef&#124grep oracle (show all processes running under the oracle username)

Look for ora_pmon_instance-name for each database - if you show no "pmon" (process monitor) processes running, then your DB's might be down

Hope that helps !
Re: database is open or not [message #49809 is a reply to message #49807] Mon, 11 February 2002 05:31 Go to previous messageGo to next message
satyajit vats
Messages: 3
Registered: February 2002
Junior Member
Thanx Daniel,
You are right .
But my question was that i want to check all of my database is OPEN or not,becasue i have 10 database and there is automated script which run at evrey friday for backup, which shut down all the database and take full offline backup of all databases and then open all the database.
But for the last one month it happen 2-3 times that some of my database started up to MOUNT stage but does not get OPEN.
So is there any way to know which database is not OPEN so than means hangs up to nomount or mount stage .

Thanx and Regards

satyajit
Re: database is open or not [message #49814 is a reply to message #49805] Mon, 11 February 2002 10:19 Go to previous messageGo to next message
Jaosn
Messages: 3
Registered: February 2002
Junior Member
Try: select status from v$instance;
Re: database is open or not [message #49824 is a reply to message #49805] Tue, 12 February 2002 05:56 Go to previous messageGo to next message
Grant
Messages: 578
Registered: January 2002
Senior Member
This may work for you.

#!/bin/ksh
#
# Created 2/12/02 - Grant Howell
# Name: chkdb
#
# Read /var/opt/oracle/oratab file to get required info. Assumes all entries are in tnsnames
# and SID is the alias name.
#
PASSWD=`cat $HOME/passwd/sys` # Get password for sys.
cat /var/opt/oracle/oratab | while read LINE
do
case $LINE in
#*) ;; #Comment line
*)
# Proceed only if third field is 'N'. We are a cluster so it will be "N" instead on "Y".
if [[ "`echo $LINE | awk -F: '{print $3}' -`" = "N" ]] ; then
ORACLE_SID=`echo $LINE | awk -F: '{print $1}' -`
export ORACLE_SID
ORACLE_HOME=`echo $LINE | awk -F: '{print $2}' -`
export ORACLE_HOME
. $HOME/$ORACLE_SID # Execute script in home dir to define Oracle environment.
sqlplus -s sys/$PASSWD@$ORACLE_SID &#124& # Open a pipe to SQL*Plus
print -p -- 'set feed off pause off pages 0 head off veri off line 500'
print -p -- 'set term off time off'
print -p -- "set sqlprompt ''"
print -p -- "select status from v$instance;"
read -p STATUS
print -p -- exit
if [[ "$STATUS" = "" ]]; then
echo "Database is not started!"
elif [[ "$STATUS" = "MOUNTED" ]]; then
echo "Database is Mounted!"
elif [[ "$STATUS" = "OPEN" ]]; then
echo "Database is Open!"
fi
fi
esac
done
Re: database is open or not [message #49826 is a reply to message #49807] Tue, 12 February 2002 06:45 Go to previous message
Krishnan
Messages: 18
Registered: October 2000
Junior Member
Hi,
From u r Unix prompt running the command
ps -eaf &#124grep pmon
must work.

Regds
Krishnan
Previous Topic: Re: ORA-01034: ORACLE NOT AVAILABLE
Next Topic: Re: Free OCP Papers
Goto Forum:
  


Current Time: Tue Dec 24 10:32:46 CST 2024