To kill the session at the operation system level, we need to identify the process ID of the session. Following query will give us the process/thread ID (SPID) of a session we know SID:
SELECT <strong>p.spid</strong>, s.osuser, s.program
FROM v$process p, v$session s
WHERE p.addr = s.paddr and s.sid = :SESSION_ID;
To kill the session on the Windows operating system, just use “orakill” utility (comes with Oracle):
To kill the session on the Unix operatin system, you can use “kill” command:
If after a few minutes the process hasn’t stopped, you can force the session to terminate by using “-9″ parameter:
While killing a process, make sure that you are not killing background processes of Oracle such as DBWR, LGWR, SMON, PMON. If you kill one of them, Oracle will crash or become unstable.