分类: Oracle
2011-05-17 17:16:07
编译的存储过程的时候,程序死住,等待一会出现ora-04021错误
解决办法:
1.可能被锁住 查看v$locked
select
b.sid,b.serial#,b.machine,b.terminal,b.program,b.process,b.status from v$lock a
, v$session b
where a.SID = b.SID
得到死锁session的SID,SERIAL#
参看这个是否为你自己用户下的,然后kill掉session
2.可能被挂起 查看v$session_wait
select b.serial#,a.* from v$session_wait a,v$session b
where a.sid = b.sid
得到等待的session的sid和serial#
3.查看dba_ddl_locks
select session_id
sid, owner, name, type,
mode_held held, mode_requested request
from dba_ddl_locks
where name = '&your_package_name'