ORA-04061: existing state of string has been invalidated
Cause: Attempt to resume the execution of a stored procedure using the existing state which has become invalid or inconsistent with the stored procedure because the procedure has been altered or dropped.
Action: Try again; this error should have caused the existing state of all packages to be re-initialized.
常见的案例是,当数据库中某些对象,如存储过程,视图或函数被修改,或卸载,用户仍在执行某些操作时。这些操作会使用现有的对象状态,但由于它们被更改了,这些状态就失效了,从而导致ORA-04061错误。
正常处理方法及步骤:
1. 检查报错信息,确定失效的对象。
2. 尝试重新编译失效的对象,确保该对象没有被人为修改。
3. 通过 alter package / procedure / trigger / view / functions 语句重新编译对象
4. 卸载已经被更改的包,然后再重新装载它,以确保它有效
5. 重新启动数据库。