Oracle数据表解锁

查找所有锁定表的Session

SELECT s.username,
decode(l.type, 'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL) LOCK_LEVEL,
o.owner,
o.object_name,
o.object_type,
s.sid,
s.serial#,
s.terminal,
s.machine,
s.program,
s.osuser
FROM v$session s, v$lock l, dba_objects o
WHERE l.sid = s.sid AND o.object_Name='TableName'
AND l.id1 = o.object_id(+)
AND s.username is NOT Null

解锁

 alter system kill session 'sid,serial#';
posted @ 2012-08-29 17:04  ido  阅读(395)  评论(0编辑  收藏  举报