oracle 查看锁表并解锁

阅读更多

先查询出锁:

SELECT /*+ rule */ 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 l.id1 = o.object_id(+)
AND s.username is NOT Null


杀掉锁:

ALTER SYSTEM KILL SESSION 'SID,SERIAL#';  


SID和SERIAL#就是上面sql 查询出来对应的值

你可能感兴趣的:(oracle,锁表,解锁)