|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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:
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 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:
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||