As you know, there are times when it is necessary to terminate all Oracle processes (process) or a specified set of Oracle processes. When the database is "locked" and you are unable to enter Server Manager to "gently" terminate the database, you can terminate all Oracle processes with the KILL command in Unix-one of the common uses of the KILL command.
When you need to terminate an Oracle instance (instance) on a UNIX server, perform the following steps:
Terminates all Oracle processes related to ORACLE_SID.
Use the IPCS–PMB command to identify all pieces of RAM memory occupied.
Use the ipcrm-m command to free up RAM memory from UNIX.
For Non-aix only: Use the IPCS-SA command to display the Occupy tag, and use the Ipcrm–s command to release the occupation tag of the instance.
It is easy to create a single command to terminate the Oracle process associated with a pending (hung) database instance. In the example below, we use the PS directive to identify the Oracle process, and then use the AWK program to get the process ID of the Oracle process ID,PID. We then enter the process ID into the KILL command for UNIX.
root> Ps-ef|grep $ORACLE _sid| \
Grep-v Grep|awk ' {print $} ' |xargs-i kill-9 {}
After terminating all Oracle procedures, we can use the IPCS–PMB directive to check for memory consumption and to clear the memory occupied by the database. We first show all the memory consumed on the database server:
Root> IPCS-PMB
IPC status From/dev/kmem as of Mon Sep 16:45:16 2001
t id key mode owner GROUP SEGSZ CPID Lpid
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 & nbsp; 4 0x06347849--rw-rw-rw- root root 77384 1346 1361
Here, we see that Oracle has only one id=24064 RAM memory. The following command will release this memory fragment:
Root> ipcrm-m 24064