Home  >  Article  >  Database  >  关于oracle表被锁住的相关处理

关于oracle表被锁住的相关处理

WBOY
WBOYOriginal
2016-06-07 15:51:161363browse

场景:当插入一条数据的时候,发现需要很长时间 接下来,需要查询是否被锁表 SELECT object_name, machine, s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid; 然后找到被

场景:当插入一条数据的时候,发现需要很长时间

接下来,需要查询是否被锁表

SELECT object_name, machine, s.sid, s.serial#
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid; 

然后找到被锁的表 解锁

--释放SESSION SQL:
--alter system kill session 'sid, serial#';
ALTER system kill session '23, 1647'; 


Statement:
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