Call for Oracle support & training (800) 766-1884
Free Oracle Tips

Corporate Oracle Training
Custom Oracle Training
Oracle New Features Training
Advanced Oracle DBA Classes
Oracle Tuning Courses
Oracle Tips & Tricks
Oracle Training Links
Oracle Training Links
Oracle Training Links

We are top for USA Oracle Training Clients


Free Oracle Tips


Free Oracle App Server Tips


Oracle support

Oracle training

Oracle tuning


Remote Oracle

Custom Oracle Training

Donald K. Burleson

Oracle Tips

Using the UNIX kill command with Oracle Processes

As we know, there are times when it is necessary to kill all Oracle processes, or a selected set of Oracle processes.  A common use of the UNIX kill command is when you need to kill all Oracle processes when the database is “locked” and he cannot enter server manager are gracefully stop the database.

When you are forced to terminate an Oracle instance on a UNIX server, you have to perform the following steps:

  1. Kill all Oracle processes associated with the ORACLE_SID

  2. Use the ipcs –pmb command to identify all held RAM memory segments, the then use the ipcrm –m command to release the RAM memory from UNIX.

  3. (non_AIX only) Use the ipcs –sa command to display held semaphores and then use the ipcrm –s command to release the held semaphores for the instance

For the Oracle professional, it is easy to create a single command to terminate all Oracle processes associated with your hung database instance.  In the example below, we use the ps command to identify the Oracle processes and then use the awk utility to extract the process ID (PID) for the Oracle processes.  We then pipe the process ID into the UNIX kill command:

root> ps -ef|grep $ORACLE_SID| \

      grep -v grep|awk '{print $2}'|xargs -i kill -9 {}  

Now, after we have killed all Oracle processes, we can then check for held memory using the ipcs –pmb command and remove the memory held by the database.  We start by displaying all held memory segments on the database server.

root> ipcs -pmb

IPC status from /dev/kmem as of Mon Sep 10 16:45:16 2001
Shared Memory:
m   24064 0x4cb0be18 --rw-r----- oracle    dba 28975104  1836 23847
m       1 0x4e040002 --rw-rw-rw-   root   root    31008   572   572
m       2 0x411ca945 --rw-rw-rw-   root   root     8192   572   584
m    4611 0x0c6629c9 --rw-r-----   root   root  7216716  1346 23981
m       4 0x06347849 --rw-rw-rw-   root   root    77384  1346  1361

Here we see that the only RAM memory segment owned by Oracle is ID=24064.  The following command will release this memory segment:

root> ipcrm –m 24064

If you like Oracle tuning, you might enjoy my latest book “Oracle Tuning: The DefinitiveReference” by Rampant TechPress. (I don’t think it is right to charge a fortune for books!) and you can buy it right now at this link:




Oracle performance tuning book



Oracle performance tuning software

Oracle performance tuning software
Oracle performance Tuning 10g reference poster
Oracle training in Linux commands
Oracle training Excel
email BC:

Copyright © 1996 -  2014 by Burleson Inc. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.