Site icon IT Tutorial

ORA-00031: session marked for kill

I got ” ORA-00031: session marked for kill ”  error in Oracle database.

 

ORA-00031: session marked for kill

 

Details of error are as follows.

ORA-00031: session marked for kill.

Cause: The session specified in an ALTER SYSTEM KILL SESSION command cannot be killed 
immediately (because it is rolling back or blocked on a network operation), but it has been 
marked for kill. This means it will be killed as soon as possible after its current 
uninterruptible operation is done.

Action: No action is required for the session to be killed, but further executions of the 
ALTER SYSTEM KILL SESSION command on this session may cause the session to be killed sooner.

 

 

session marked for kill

This ORA-00031 error is related with the session specified in an ALTER SYSTEM KILL SESSION command cannot be killed immediately (because it is rolling back or blocked on a network operation), but it has been marked for kill. This means it will be killed as soon as possible after its current uninterruptible operation is done.

 

No action is required for the session to be killed, but further executions of the ALTER SYSTEM KILL SESSION command on this session may cause the session to be killed sooner.
DBA or Priviliged user can kill the sessions according to their SID or Username OSUSER as follows bulkly.
SELECT 'kill -9 ' || p.spid, s.username,
'alter system kill session ''' || SID || ',' || s.serial# || ',@'||s.inst_id||''';'
FROM gv$session s, gv$process p
WHERE s.paddr = p.addr(+)
AND s.SID=1453;




SELECT 'kill -9 ' || p.spid, s.username,
'alter system kill session ''' || SID || ',' || s.serial# || ',@'||s.inst_id||''';'
FROM gv$session s, gv$process p
WHERE s.paddr = p.addr(+)
AND s.SID=167 and s.username='MEHMET';,




SELECT 
'alter system kill session ''' || SID || ',' || s.serial# ||',@'||p.inst_id|| ''';'
FROM gv$session s, gv$process p
WHERE s.paddr = p.addr(+)
and s.TYPE ='USER'
AND s.osuser='MEHMET.DEVECI';

 

Do you want to learn Oracle Database for Beginners, then read the following articles.

Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )

 

Exit mobile version