Monday, May 28, 2012

To kill a session using orakill utility.

In Windows we have several utilities, the Oracle-centric "orakill" utility and the Windows "taskkill" program.  The Windows command to kill this session would be as follows. just you have to go inside the oracle installed folder (Example I mentioned below.)
step1: C:\oracle\product\10.2.0\db_1\BIN\orakill instance_name spid

spid you can retrieve using the below query

stpe2: sql>select a.username,a.osuser,b.spid from v$session a,v$process b
 where a.paddr=b.addr
 and a.username is not null;

and instance_name you can get using the below query.

step3: sql>select instance_name from v$instance;

just mention the instance_name and spid in the above step1 command syntax.

after that check the status of the killed  user session in the database.

sql>select username,osuser,status from v$session where username='&username';

No comments:

Post a Comment