ORA-04021
编译或删除存储过程的时候,系统会卡住,一段时间后出现ora-04021错误。
1.可能被锁住
查看v$locked
1 select b.sid,b.serial#,b.machine,b.terminal,b.program,b.process,b.status 2 from v$lock a , v$session b 3 where a.SID = b.SID;
2.可能被挂起
查看v$session_wait
1 select b.serial#,a.* from v$session_wait a,v$session b where a.sid = b.sid;
3.查看dba_ddl_locks
1 select session_id sid, owner, name, type, mode_held held, mode_requested request 2 from dba_ddl_locks 3 where name = '过程名字';
得到相对应的SID和SERIAL#后,kill掉相应的session