Error: ORA 4065 Text: not executed, altered or dropped %s ------------------------------------------------------------------------------- Cause: Attempt to execute a stored procedure that has been altered or droppedthus making it not callable from the calling procedure. Action: Recompile its dependents.Error: ORA 4068 Text: existing state of packages%s%s%s has been discarded ------------------------------------------------------------------------------- Cause: One of errors 4060 - 4067 when attempt to execute a stored procedure. Action: Try again after proper re-initialization of any application"s state.可以看到,错误解释里面已经提到重新编译下就能够解决,但是显然这种解决方式并不能够彻底的处理这个问题,我们需要更进一步的查找错误的处理方法。
步骤二:查找官方文档
随后查询官方文档,找到一篇过程描述比较接近的内容,Summary of Causes for ORA-4068 and ORA-4065 in10gR2,其中给出了另外一种导致该错误的原因如下,关键内容如下:Bug 6136074 ORA-4068 ORA-4065 ORA-06508 ERRORS SIGNALED FOR VALID OBJECTSComponent: RDBMS Fixed Ver(s): 10204 111 Symptom(s): Recompilation of a view might lead to inconsistent timestamps for some of theview"s PLSQL dependents. The script inNote 136697.1can be used to check for such problem DEPENDENCY$ entries, or use the SQLbelow:set pagesize 10000 column d_name format a20 column p_name format a20 select do.obj# d_obj,do.name d_name, do.type# d_type, po.obj# p_obj,po.name p_name, to_char(p_timestamp,"DD-MON-YYYY HH24:MI:SS") "P_Timestamp", to_char(po.stime ,"DD-MON-YYYY HH24:MI:SS") "STIME", decode(sign(po.stime-p_timestamp),0,"SAME","*DIFFER*") X from sys.obj$ do, sys.dependency$ d, sys.obj$ po where P_OBJ#=po.obj#(+) and D_OBJ#=do.obj# and do.status=1 /*dependent is valid*/ and po.status=1 /*parent is valid*/ and po.stime!=p_timestamp /*parent timestamp not match*/ order by 2,1;上门的文档内容说,这个问题还可能是bug6136074引起,通过给出的查询语句,可以查询到过程时间戳不一致的情况,一般情况下,通过重新编译过程,能够使时间戳一致,但是有时候光编译还不能起到效果,这时候,就必须删除重建的方式,这里要看是什么对象,我们这里查出来是公共同义词,就只需要删除同义词重建就可以。