oracle "ORA-04068: 包的现有状态已被丢弃 ORA-04065: 未执行、更改或删除存储过程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26646123/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 00:38:41  来源:igfitidea点击:

"ORA-04068: existing state of packages has been discarded ORA-04065: not executed, altered or dropped stored procedure

oracleplsqloracle11g

提问by Tajinder

i m getting below error when i m trying to execute procedure "PROCEDURE_NAME" under procedure "CALLING_PROCEDURE_NAME". But my PROCEDURE_NAME is already in valid state and successfully using in some other procedures.

当我尝试在程序“ PROCEDURE_NAME”下执行程序“ ”时,我遇到以下错误CALLING_PROCEDURE_NAME。但是我的 PROCEDURE_NAME 已经处于有效状态并成功用于其他一些程序。

ORA-04068: existing state of packages has been discarded
ORA-04065: not executed, altered or dropped stored procedure ""PROCEDURE_NAME""
ORA-06508: PL/SQL: could not find program unit being called: ""PROCEDURE_NAME""
ORA-06512: at ""CALLING_PROCEDURE_NAME"", line LINE_NO
ORA-06512: at line 1

回答by Lalit Kumar B

But my PROCEDURE_NAME is already in valid state and successfully using in some other procedures.

但是我的 PROCEDURE_NAME 已经处于有效状态并成功用于其他一些程序。

The session where the package is currently called, it retains that state of the package. If you recompile the package, then the moment the package is called in that session again, you will hit this error.

当前调用包的会话,它保留了包的状态。如果您重新编译该包,那么在该会话中再次调用该包时,您将遇到此错误。

  1. You can execute DBMS_SESSION.RESET_PACKAGE;to free the memory, cursors, and package variables after the PL/SQL call that made the invocation finishes running.

  2. You could close all existing sessions and re-execute.

  3. You could make the package, SERIALLY_REUSABLE Packagesby using PRAGMA SERIALLY_REUSABLE;statement. If a package is SERIALLY_REUSABLE, its package state is stored in a work area in a small pool in the system global area (SGA). The package state persists only for the life of a server call.

  1. 您可以执行DBMS_SESSION.RESET_PACKAGE; 在使调用完成运行的 PL/SQL 调用之后释放内存、游标和包变量。

  2. 您可以关闭所有现有会话并重新执行。

  3. 您可以通过 using语句制作包SERIALLY_REUSABLE 包PRAGMA SERIALLY_REUSABLE;。如果一个包是SERIALLY_REUSABLE,它的包状态存储在系统全局区 (SGA) 的一个小池中的工作区中。包状态仅在服务器调用的生命周期内持续存在。