Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: dbshut script - shutdown or shutdown immediate
Here's one way to do it:
OS_USER=jkstill
USERNAME=jkstill
PASSWORD=$(pwc.pl -username $USERNAME -instance $ORACLE_SID)
echo $PASSWORD
unset SQLPATH
# emulating a 10 second shutdown
(
sqlplus -s /nolog <<EOF
connect $USERNAME/$PASSWORD@$ORACLE_SID; exec dbms_lock.sleep(10)
BG=$!
echo BG: $BG
# we only want to wait 5 seconds for shutdown # we are very impatient
sleep 5
STILL_RUNNING=$(ps -flu${OS_USER}|awk '{print $4}'|grep "^${BG}$") echo STILL_RUNNING: $STILL_RUNNING
[ -z $STILL_RUNNING ] || {
echo Took too long. You could run shutdown abort here ps -flu${OS_USER} kill -9 $BG ps -flu${OS_USER}
Jacques Kilchoer <Jacques.Kilchoer_at_quest.com>
Sent by: root_at_fatcity.com
04/03/2003 11:23 AM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: Subject: RE: dbshut script - shutdown or shutdown immediate
> -----Original Message-----
> From: Pardee, Roy E [mailto:roy.e.pardee_at_lmco.com]
>
> I would
> have guessed
> that optimally, you'd try immediate first & then abort if
> immediate takes
> too long.
I've read that some people on the list have done this. I am curious as to
how this is implemented.
How long is too long? And how is this coded? I'm trying to think how you
would write this with shell scripts for example.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: Jared.Still_at_radisys.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu Apr 03 2003 - 14:28:40 CST
![]() |
![]() |