Killing an Oracle thread on Windows

On Windows for each instance all oracle sessions are thread based and are part of one Oracle process (oracle.exe), so killing oracle.exe would crash your entire instance. Therefore using the utility orakill.exe one can kill user’s session. Using the following SQL one can find the thread id of the oracle process.

SQL> SELECT a.username, a.osuser, b.spid ThreadID, a.sid, a.serial# FROM v$session a, v$process b WHERE a.paddr = b.addr AND a.username IS NOT NULL;

————— —————————— ——— ——————————
SYS oracle 2990 rman (TNS V1-V3)
SCOTT mary 1384

So using orakill kill session mary’s session.
c:> orakill TESTDB 1384


2 thoughts on “Killing an Oracle thread on Windows

  1. Hello,

    Currently I’m working on some external system that uses Oracle 10g as its DBMS. When user logged in to this system and their process went too long they just close the application. But it turns out that sometimes the Oracle session just stays there.
    When I checked in V$Session, these session’s status is inactive. I believe these “hang” session would consume resources, so I decided to kill these sessions.
    But some other session which actually still “alive” also has the same status.
    Is there a way to tell the difference between the “alive” session from the ones that already closed?
    Thank you.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.