1. oracle 鎖表
lock
table
表名字in
exclusive
mode
;所記錄: select * from 表名字 for update
2. oracle 鎖表查詢
selectb.owner,b.object_name,a.session_id,a.locked_mode
from v$locked_objecta,dba_objects b
where b.object_id = a.object_id;
3. oracle鎖表檢視是哪個session引起的
select b.username,b.sid,b.serial#,logon_time
from v$locked_objecta,v$session b
where a.session_id =b.sid order by b.logon_time;
4. 檢視連線工具
select substr(v$lock.sid,1,4) "sid",serial#,v$session.sid,
substr(username,1,12)"username",
substr(object_name,1,25)"objectname",
v$lock.type"locktype",
decode(rtrim(substr(lmode,1,4)),
'2','row-s (ss)','3','row-x(sx)',
'4','share', '5','s/row-x (ssx)',
'6','exclusive', 'other' )"lockmode",
substr(v$session.program,1,25) "programname"
from v$lock,sys.dba_objects,v$session
where (object_id = v$lock.id1
and v$lock.sid = v$session.sid
and username is not null
and username not in ('sys','system')
and serial# != 1);
5. 殺會話 結束鎖表程序
alter
system
kill
session
'sid,serial#'
;
Oracle鎖表及鎖表使用者查詢
可在pl sql中用如下sql語句來查詢當前資料庫中哪些表被鎖住了,並且是哪些使用者來鎖的這些表 select a.owner,object所屬使用者 a.object name,object名稱 表名 b.xidusn,b.xidslot,b.xidsqn,b.session id,鎖表使用者的s...
Oracle鎖表及鎖表使用者查詢
可在pl sql中用如下sql語句來查詢當前資料庫中哪些表被鎖住了,並且是哪些使用者來鎖的這些表 select a.owner,object所屬使用者 a.object name,object名稱 表名 b.xidusn,b.xidslot,b.xidsqn,b.session id,鎖表使用者的s...
ORACLE鎖表查詢
select rule 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 objec...