Friday, August 2, 2013

How to resolve ORA-00031 on Linux based systems.

How to resolve ORA-00031 on Linux based systems.

1. First of all you should find block session id:

select  'SID ' || l1.sid ||' is blocking  ' || l2.sid blocking
from  v$lock l1, v$lock l2
where  l1.block =1 and l2.request > 0
and  l1.id1=l2.id1
and  l1.id2=l2.id2

2. With this select you can find Linux process ID and kill it:

select
sid,
spid
from v$process p, v$session s
where paddr = addr
and s.sid in(XXXX)
order by s.sid;

XXXX - it's SID from first select.

Enjoy