 |
|
How to kill an Oracle process on Windows
Oracle Tips by Burleson Consulting
October 20, 2007
|
Question: I'm used to
the "kill -9" syntax in UNIX for killing an Oracle process, but
I don't know how to kill an Oracle process on Windows.
Answer: As a quick
review, you can kill an Oracle session from within Oracle, but
that does not always terminate the OS process. First, you
get the SID and serial number of the session that you want to
kill:
select
spid,
osuser,
s.program
from
v$process p,
v$session s
where
p.addr=s.paddr;
Next, you kill the session from
insude SQL*Plus:
alter system mill session 'mysid,
myserial_no';
You can also invoke the
dbms_sql.kill_session procedure to kill a Windows
session from inside Oracle.
Killing a Windows Task
In Windows we have several
utilities, the Oracle-centric "orakill"
utility and the Windows "taskill" program. The Windows
command to kill this session would be as follows.
C:\oracle9i\bin>orakill
ORCL92 768
In this example, the windows thread corresponding to the Oracle
session can be killed in the operating system without ever
logging into the database.
You can also use the Windows
taskkill utility to remove an Oracle Windows process:
c:>tasklist
oracle.exe 9311 Console 0 5,072 K
c:>taskkill /pid 9311
SUCCESS: The process with PID 9311 has been terminated.
See my related notes on killing
Oracle processes here: