欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

ORA-04021: timeout occurred while waiting to lock object

程序员文章站 2022-09-04 15:52:30
ORA-04021: timeout occurred while waiting to lock object 某个应用正在锁定该表或者包表为select b.SID,b.SERIAL#,c.SQL_TEXTfrom v$locked_object a, v$session b, v$sqlare ......

ora-04021: timeout occurred while waiting to lock object

某个应用正在锁定该表或者包
表为
select b.sid,b.serial#,c.sql_text
from v$locked_object a, v$session b, v$sqlarea c
where a.session_id = b.sid
and b.sql_address = c.address
and c.sql_text like '%table_name%';
包为
select b.sid,b.username,b.machine from v$access a, v$session b where a.sid=b.sid and a.object = '%package_name%' and a.type = 'package';
找出这个session
然后 kill
alter system kill session 'sid,serial#';