Windows ORAKILL utility usage-Syntax to Kill Oracle thread



The Eucharistic Miracles of the World

Oracle Utility orakill for windows
There are two ways to kill an oracle process (UNIX) or thread (windows). First, kill the session from database with sys as sysdba privilege using the command alter system kill session ‘sid, serial#’. Secondly, kill the process or thread from OS level. The first one has some limitations as it needs oracle database access.
Sometimes oracle database will not be allowing any connections to the database because of high resource utilisation. Then killing the sessions from the database side would be a question.
Alter system command will not clear any locks. Instead, the session will remain connected until it time out. In this situation the DBA has to kill the thread or process from the OS level using kill or orakill. On UNIX kill -9 <spid> is the syntax to kill the process. Spid can be get it from the database using below mentioned query.
Select sess.username, sess.osuser, sess.sid, sess.serial#, proc.spid
  from v$session sess,v$process proc
 where sess.paddr = proc.addr
   and sess.username is not null;
On windows if we you the task manager to kill a threads it will kill the background threads and crash the database. This will make the serious damage to the database. So oracle provides a utility (ORAKILL) to kill the threads in windows and it is available in $ORACLE_HOME/bin directory.
Its usage is orakill <SID> <SPID> and it can be initiated from the DOS prompt.
Example: C:\oracle9i\bin>orakill PRODDB 5860
You have to be very careful using orakill not to kill the oracle background processes. By mistake if you kill the oracle mandatory background processes like pmon, you will probably crash the databse.
Any user with access to the box can access the orakill and task manager. So, access to the windows box must be secure.


Website Stats


Post a Comment


Oracle (629) Script (86) General (77) Unix (47) Blog (23) Technology (19) gadget (6) games (6) Business (3) OCI (3) SQL* Loader (3) Datapump (2) Copyright 2011-23 All Rights Reserved | Site Map | Contact | Disclaimer