Oracle Bug 6136074 encountered at work, a bug of 10203, is the first time this problem was encountered.
On 10.2.0.3, a bug may cause compilation or view failure. The failure may not only result in unavailability of the current view or process, but may affect the entire data dictionary, this results in a ORA-04068 error when the stored procedure is executed.
The error message is as follows:
ORA-04068: existing state of packages has been discarded.
ORA-04065: not executed, altered or dropped stored procedure P_PACKAGE.P_PRO
ORA-06508: PL/SQL: cocould not find program unit being called: P_PACKAGE.P_PRO
ORA-06512: at line 1
This problem corresponds to the BUG information: Bug 6136074-ORA-04068/ORA-04065 ORA-06508 on VALID objects [ID6136074.8], the cause is that the time stamps of PLSQL dependent objects are inconsistent during object compilation, resulting in problems.
The Oracle document provides the SQL statement to check the problem:
Select do. obj # d_obj, do. named_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;
Using this script to re-compile the obtained object can solve this problem. To avoid the problem, you should upgrade the database version to 10.2.0.4 or later.