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: Potluri, Venu (GTI) <venu_potluri_at_ml.com>
Date: Mon, 27 Feb 2006 15:59:39 -0500
Message-ID: <F65245818C52764E83192CFDA540095A148523CC@mlnyb705mb.amrs.win.ml.com>


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

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Robyn Sent: Monday, February 27, 2006 3:51 PM
To: chupit_at_gmail.com
Cc: Oracle-L_at_Freelists
Subject: Re: hanging shutdowns

Edgar,

 We have online backups in place and they are run every night. We are also required to run a weekly cold backup; not something I agree is necessary, but I've been overruled in this case.

 We have run tests and these databases have hung for hours without completing a shutdown immediate (not often, but it has happened). We've juggled job schedules to minimize processing immediately prior to the backup, but that didn't fix the problem.

 This is a BCV split backup on HP-UX and we're required to have the system back on line within about 15 minutes. I'm planning to try Mark's suggestion of using 'startup force' and have added Jeremiah's recommended 'alter system checkpoint'. I've got a window to run the new script on our test server at 5:00 pm.

 And although I would rather not shut the database down at all, I think this is an improvement over the script that is currently is use and that's enough to make me happy for now.

 Thanks to all for the input ...Robyn

On 2/27/06, Edgar Chupit <chupit_at_gmail.com> wrote:
> Dear Jeremiah,
>
> First of all, I would like to mention that I don't like to shutdown
> database without any practical reason (like hardware/OS
> maintenance/upgrades/etc).
>
> And still I would like to argue that under normal circumstances
> startup force restrict + shutdown immediate (or shutdown abort,
> startup force, shutdown immediate) will run almost as fast and is as
> dangerous as a single shutdown immediate.
>
> After shutting down abort in order to perform cold backup you still
> need to startup database and close it in consistent mode. Database
> startup is not very fast process in it self, because Oracle not only
> needs to recover database into consistent state (rollback uncommitted
> transactions), but also allocate memory structures and prepare itself
> for a normal work. And to shutdown database in consistent state you
> still need to issue shutdown immediate.
>
> One of the popular reasons why shutdown immediate can take a longer
> time to proceed is because Oracle waits for SNP process to wakeup
> (Note: 1018421.102), but this can also happened when the shutdown
> immediate is called second time (after startup force), so even
> checkpointing and using startup force restrict can cause database to
> hang in shutdown immediate mode.
>
> Also, there is a Note: 46001.1 that suggest to minimize usage of
> shutdown abort on Windows systems, because it can cause "allocation
> problems when Oracle is next started.". Note: 161234.1 that describes
> situation when shutdown abort can hang. Note: 222553.1 that states
> that startup force can be safer than shutdown abort. And plenty of
> other notes that describes different problems that can occur during
> database shutdown.
>
> And surely there are many bugs that can occur after shutdown abort
> (but under normal circumstances shutdown abort is very safe).
>
> Saying all this, I would like to return to thread subject and suggest
> to the original poster to try to convince the management to switch to
> hot backups, and forget about shutting down the databases because of
> backup at all.
>
> On 2/27/06, Jeremiah Wilton <jeremiah_at_ora-600.net> wrote:
> > If you 'alter system checkpoint' before the 'shutdown abort' then it

> > should be a lot faster for the user with a hanging or prolonged
> > 'shutdown immediate'.
>
> > Jeremiah Wilton
> > ORA-600 Consulting
> > Recoveries - Seminars - Hiring
> > http://www.ora-600.net
>
>
> --
> Best regards,
> Edgar Chupit
> callto://edgar.chupit
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
Robyn Anderson Sands
email: Robyn.Sands_at_SciAtl.com
--
http://www.freelists.org/webpage/oracle-l
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Feb 27 2006 - 14:59:39 CST

Original text of this message

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