Friday, 11 September 2020

ORA-04061: existing state of has been invalidated ORA-04061: existing state of package body "package name" has been invalidated

Ideally this error comes when the package in question is Invalid but sometime we see this error even if our package is Valid.


Instead of getting into too much details and debugging just request your DBAs to recompile the package or do it yourself if you are a confident developer with apps access ;) 


To compile both of sepc and body :-

                                Alter package pkg_name compile;


To compile only Body :-

                                Alter package pkg_name compile body;

If its recompiled without any error then just retest.

That's it.