oracle 锁查询
时间:2011-04-12 来源:CodeFarmer
--查询用户的对象持有的锁 'SINOLIFE_DEV'为示例的用户名
select dbl.lock_type,
dbl.mode_held,
dbl.blocking_others,
dbo.OBJECT_NAME,
dbo.OBJECT_TYPE
from dba_locks dbl, v$session v, dba_objects dbo
where v.USERNAME = 'SINOLIFE_DEV'
and dbl.session_id = v.SID
and dbo.OBJECT_ID = dbl.lock_id1
--查看用户的会话是否被挂起
select d.session_id,
d.lock_type,
d.mode_requested,
d.mode_held,
d.blocking_others
from dba_locks d, v$session v
where v.USERNAME = 'SINOLIFE_DEV'
and v.SID = d.session_id
相关阅读 更多 +
排行榜 更多 +