Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: hanging shutdowns

RE: hanging shutdowns

From: <oracle-l-bounce_at_freelists.org>
Date: Mon, 27 Feb 2006 15:36:49 -0600
Message-ID: <FB5D3CCFCECC2948B5DCF4CABDBE6697545E8E@QTEX1.qg.com>


Beware that on some Unix's versions, "kill -9" may cause memory held by those processes to not be reclaimed. This will eventually lead to rebooting. At the very least, try to "kill -15" (the usual default of kill) first and only use "-9" if that's unsuccessful. I know HP/UX 10.x suffered from this, but I'm not sure about 11.x or Solaris/Linux/etc.

Also beware that the columns to cut may change, depending on platform and kernel settings. A long-lost memory has me thinking I've seen 6-digit PIDs in the past.

I miss the way DCL on VMS could use system hooks for this kinda stuff, instead of relying on program output that's been formatted for humans...

Rich

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Potluri, Venu (GTI) Sent: Monday, February 27, 2006 3:00 PM
To: Oracle-L_at_Freelists
Subject: RE: hanging shutdowns

I use the script below to kill all database sessions prior to shutting down the database. It is used as part of a larger script that shuts down various components and once the database sessions are killed, then the database is shutdown normal and listener is shutdown. Never had a problem other than it takes up to 15 minutes to shutdown the database, depending on how many connections exist.

#
# kill_db_connections.sh

#
# Kill Oracle Connections
#

echo "Checking for any Oracle Database Connections" ccount=0
ccount=`ps -ef | grep $1 | grep LOCAL | grep -v grep | wc -l` if [ "$ccount" -ne "0" ]
then

   /usr/bin/kill -9 `ps -ef | grep $1 | grep LOCAL | grep -v grep | cut -c9-14`
fi
sleep 60
# Check Again

ccount=0
ccount=`ps -ef | grep $1 | grep LOCAL | grep -v grep | wc -l` if [ "$ccount" -ne "0" ]
then

   /usr/bin/kill -9 `ps -ef | grep $1 | grep LOCAL | grep -v grep | cut -c9-14`
fi
sleep 60

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Feb 27 2006 - 15:36:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US