Oracle教程:Oracle中kill死結進程

來源:互聯網
上載者:User

Oracle教程:Oracle中kill死結進程

Oracle中對於訪問頻率很高的包,預存程序或者函數,會引起死結。對於用到了死結的對象的指令碼都會無法運行,造成卡死,或者報異常:開啟的串連太多。

這時需要使用dba許可權賬戶去kill掉死結的對象。

使用

alter system kill session 死結對象的ID;

執行如下sql,尋找出死結的ID,並將alter語句拼接好:

select Distinct 'alter system kill session '||chr(39)||b.sid||','||b.serial#||chr(39)||';'As  kill對象sql語句,
b.username,b.logon_time
from v$locked_object a,v$session b
where a.session_id=b.sid
order by b.logon_time;

然後將拼接的語句拿出來執行即可。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.