Home > Database > Mysql Tutorial > body text

ORA-00054:Oracle查询被锁的对象及解决方法

WBOY
Release: 2016-06-07 16:48:28
Original
1281 people have browsed it

一般情况下报ORA-00054时,就很有可能有对象被锁住了,这个错误一般都是ldquo;资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超

一般情况下报ORA-00054时,就很有可能有对象被锁住了,这个错误一般都是“资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效”,,其解决方法如下:
 
1、查询哪些对象被锁
 
select object_name,machine,s.sid,s.serial#
 from v$locked_object l,
 dba_objects o ,
 v$session s
 where l.object_id = o.object_id and l.session_id=s.sid;

2、杀死进程
 
alter system kill session 'sid,serial#';

一般情况下这样就解决了锁对象问题,但有时可能还会产生ORA 00031错误“session marked for kill”
 
这说明被锁的对象长时间没有被释放,需要用OS去杀进程
 
1、查找出锁对象的进程ID
 
select spid, oSUSEr, s.program
 from v$session s,v$process p
 where s.paddr=p.addr and s.sid=sid(这里的sid是上面查询出来的)

2、找到进程后kill -9去杀掉

本文永久更新链接地址:

linux

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!