Forum OpenACS Q&A: Re: Oracle /etc/init.d scripts should use shutdown immediate

On Linux (Debian 3.0, kernel 2.4.18) I did the following tests with Oracle

Manually start up AOLserver which connects to Oracle, then run "sudo /etc/init.d/oracle8i stop". Oracle does not shut down, script hangs, but leave that script there, let it keep trying throughout the rest of the next steps. Kill AOLserver. Oracle is still not shutting down, ps -ef shows two nsd processes or threads parented to 1. Plain kill of those two processes has no effect. kill -9 killes the two nsd processes. Immediately after kill -9 of remaining nsd processes, Oracle successfully shuts down.

Edit $ORACLE_HOME/bin/dbshut to use "shutdown immediate" instead of plain "shutdown". The relevent part of the script should now look like this:

      case $VERSION in
                  6)  sqldba command=shutdown ;;
                  *)  $SQLDBA >>EOF
connect internal
shutdown immediate
After changing the dbshut script, start up Oracle, manually start up AOLserver, run "sudo /etc/init.d/oracle8i stop", and bam, Oracle shuts down right away. (The running AOLserver, of course, will now error out when trying to talk to Oracle.)

Seems very repeatable and clear. Therefore, I have switched to using "shutdown immediate" from my shutdown scripts like the above, on both Linux and Solaris.