查看系统中哪个表被锁定
程序员文章站
2022-06-15 12:09:14
...
查看系统中哪个表被锁定 Sql代码 www.2cto.com select lpad( ,decode(l.xidusn,0,3,0))||l.oracle_username User_name, o.owner,o.object_name,o.object_type,s.sid,s.serial# from v$locked_object l,dba_objects o,v$session s where l.object_id=o.object
查看系统中哪个表被锁定
Sql代码 www.2cto.com
select lpad(' ',decode(l.xidusn,0,3,0))||l.oracle_username User_name,
o.owner,o.object_name,o.object_type,s.sid,s.serial#
from v$locked_object l,dba_objects o,v$session s
where l.object_id=o.object_id
AND l.session_id=s.sid
order by o.object_id desc
好长的,不好记。所以写下留个备注哈。
有两个的,一个是表锁TM,一个是行锁TX
你从v$lock中也能看出来
by:piner