s.serial#,
l.locked_mode,
l.oracle_username,
l.os_user_name,
s.machine,
s.terminal,
o.object_name,
s.logon_time FROM v$locked_object l,
all_objects o,
v$session s WHERE l.object_id = o.object_id ANd l.session_id = s.sid ORDER BY sid,
s.serial#
解锁:ALTER system KILL session 'sid,serial#'
查询锁住原因:SELECT b.sid oracleID,b.username 登录Oracle用户名,b.serial#,spid *** 作系统ID,paddr,
sql_text 正在执行的SQL,b.machine 计算机名 FROM v$process a, v$session b, v$sqlarea c
WHERE a.addr = b.paddr AND b.sql_hash_value = c.hash_value and b.USERNAME='FKPHIS24'
在对指定表做append *** 作,其他再做truncate时候,会产生锁表,如下验证步骤,
1、创建测试表,
create table test_lock(id number, value varchar2(200))
2、执行append语句;并且不做提交,insert /*+append*/ into test_lock values(1,1)
3、再次执行清表语句,truncate table test_lock报锁表错误,
4、查看锁表语句,发现被锁表,
select b.object_name, t.*
from v$locked_object t, user_objects b
where t.object_id = b.object_id
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)