Home > Database > Mysql Tutorial > body text

Oracle教程:Oracle中kill死锁进程

WBOY
Release: 2016-06-07 15:21:20
Original
1075 people have browsed it

Oracle中对于访问频率很高的包,存储过程或者函数,会引起死锁。对于用到了死锁的对象的脚本都会无法运行,造成卡死,或者报异常

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;

然后将拼接的语句拿出来执行即可。

本文永久更新链接地址

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!