Monday, April 12, 2010

Resolve the problem "ORA-00031: session marked for kill"

If get "ORA-00031: session marked for kill" from oracle database then Follow the

Simulation Steps 1:

SQL> ALTER SYSTEM KILL SESSION '205,32449' IMMEDIATE;
ALTER SYSTEM KILL SESSION '205,32449' IMMEDIATE
*
ERROR at line 1:
ORA-00031: session marked for kill

SQL> SELECT s.sid,
s.serial#,
s.osuser,
s.program
FROM v$session s;

Select from query your desire sid and serial# no from query

Steps 2:

Find out the your desire thread id (needed to be os level kill session)

SQL>select
spid,
osuser,
s.program
from v$process p,
v$session s
where p.addr=s.paddr



For Windows
Operating System

C:> orakill ORACLE_SID spid

note: ORACLE_SID means oracle unique database name

like>

C:> orakill test 1236

Finally your database session and OS child level session has been killed.

For UNIX Operating System

Check the SPID from UNIX Process

Test# % ps -ef | grep ora

Then Run following:

Test# % kill -9 spid

6 comments:

  1. thanks dulal vai,
    now tell me what is the necessity or benifits of kill session

    pavel(speiil)

    ReplyDelete
  2. If your concurrent application or db users session are locked or "ORA-00031" error raised.

    ReplyDelete
  3. hi.
    it's OS commands so, you didn't run in TOAD.

    ReplyDelete