RE: hanging shutdowns

  • To: "Oracle-L@Freelists" <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 27 Feb 2006 15:36:49 -0600

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@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Potluri, Venu (GTI)
Sent: Monday, February 27, 2006 3:00 PM
To: Oracle-L@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
--
//www.freelists.org/webpage/oracle-l


Other related posts: