查杀oracle的阻塞
cuihengju8933 2018-07-22 20:12:32 42 收藏执行以下脚本抓目前的阻塞:
select
(select username||":"||sid||":"||serial# from v$session where sid=a.sid) ||
" locked " ||
(select username ||":"||sid||":"||serial# from v$session where sid=b.sid)
from v$lock a, v$lock b
where a.block = 1
and b.request > 0
and a.id1 = b.id1
and a.id2 = b.id2;
找到目前的阻塞源:
select b.SQL_TEXT,a.SID,a.SERIAL# from v$session a, v$sqlarea b where a.SQL_HASH_VALUE = b.HASH_VALUE(+) and sid=&sid;
杀掉目前的阻塞源:
alter system kill session "5,35133"immediate;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22996654/viewspace-2158304/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22996654/viewspace-2158304/