Wednesday, May 21, 2008

Show lock on table in oracle and unlock them

Show lock
=========
select O.object_name,
O.object_type,
S.sid,
S.serial#,
L.oracle_username,
L.os_user_name,
L.locked_mode
from dba_objects O,
v$locked_object L,
v$session S
where O.object_id = L.object_id
and S.sid = L.session_id
=============

Unlock
ALTER SYSTEM KILL SESSION 'sid, serialid';

Google