标签:sid -- 执行 bsp 应该 object _id === access
很慢的原因有可能是DB出现死锁现象
排查是否有死锁发生
select b.owner,b.object_name,a.session_id,a.locked_mode
from v$locked_object a,dba_objects b
where b.object_id = a.object_id;
select b.username,b.sid,b.serial#,logon_time
from v$locked_object a,v$session b
where a.session_id = b.sid order by b.logon_time;
杀死锁
alter system kill session ‘145,6‘
select b.username,b.sid,b.serial#,logon_time
from v$locked_object a,v$session b
where a.session_id = b.sid order by b.logon_time;
USERNAME SID SERIAL# LOGON_TIME
------------------------------ ---------- ---------- -----------
WSSB_RTACCESS 39 1178 2006-5-22 1
WSSB_RTACCESS 29 5497 2006-5-22 1
杀会话
alter system kill session ‘sid,serial#‘;
alter system kill session ‘29,5497‘;
========================
alter system kill session ‘sid, serial#‘ 如上面查出来的一条记录的sid是53, serial#为663,
就执行以下的语句alter system kill session ‘53,663‘ 如果要一次性杀死多个会话,一个一个填写sid和serial#十分的繁琐,
应该在查询被锁对象的同时拼凑出多条的杀会话语句,以分号分隔,一起复制下来,然后就可以批量的执行了
标签:sid -- 执行 bsp 应该 object _id === access
原文地址:https://www.cnblogs.com/cslc-zl/p/9172635.html