Home >Database >Mysql Tutorial >查看系统中哪个表被锁定

查看系统中哪个表被锁定

WBOY
WBOYOriginal
2016-06-07 14:53:591339browse

查看系统中哪个表被锁定 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

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn