Kill Oracle Processes
Free your shutdown immediate
Never implement this
kill oracle processes script on a production server !
It is not supported by Oracle.
It is not supported by Oracle.
Killing a process before it completes elegantly ?
Unheard of.
Definitely not part of the Oracle training manuals.
However, I started realizing its value when I was waiting for the hundredth
time for a
shutdown immediate to complete on a unix system.
So I relented, and even though I still get nervous, I use it regularly.
I must repeat that you should never do this on a production system.
Oracle does not support this.
Follow these steps at your own risk.
The logic behind the script is as follows:
- Run a script which lists all the process ids of the 'LOCAL=NO' connections
and pipe a kill command
with those process ids to a second file. - Execute the second file which effectively kills the processes.
Assumption :
There is only one database instance on the server.If you have more than one database running, you will need to adapt the script,
otherwise you will end up killing connections to the other databases too.
Risk:
- Once the second script (runkill.sh) has been created, it contains hard-coded process ids.
- If you run runkill.sh at a later stage, without repopulating it with
fresh process ids,
you will kill processes which are totally unrelated to the ones you wanted to kill. - For the same reason, you must run runkill.sh as quickly as possible
after it has been created,
so that there is no chance of killing the wrong process by accident. - You need to change the permissions of both scripts to be executable
before they can run.
- chmod 744 *Kill.sh
So: the script is by no means perfect, carries a security risk and is totally unsupported by Oracle.
Use at your own peril.
The scripts:
First script: BuildKill.sh
ps -ef | grep "LOCAL=NO" | awk {'print "kill -9 " $2'}
> RunKill.sh
To run the first script:
./BuildKill.sh
To run the second script:
./RunKill.sh