每天在每两个小时运行一次但在一天的不同时间运行的脚本上,我们每天都会收到此错误。
ERROR at line 1: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "PACKAGE.NAME" has been invalidated ORA-06508: PL/SQL: could not find program unit being called: "PACKAGE.NAME" ORA-06512: at line 1
有人可以列出什么情况会导致此错误,以便我们进行调查吗?
谢谢。
更新:执行'ALTER SESSION CLOSE DATABASE LINK DBLINK'会使包的状态无效吗?
'ALTER SESSION CLOSE DATABASE LINK DBLINK'
这个班轮实际上解决了所有问题:
PRAGMA SERIALLY_REUSABLE;
确保全局变量是无状态的,以避免出现任何问题。