When compiles an object that is referenced by many others, they stay invalidated until Oracle compile they again and sometimes it fails.
So, here’s a tip to compile several invalid packages, procedures and/or functions and fix this.
There is a command to compile all invalid objects under an user, the command is:
<pre class=”brush:sql”>exec dbms_ultility.compile_schema(<USER>);</pre>
Replace <USER> for <i>user</i>, or for user name where invalid objects are.
This command is slow and not compiles objects invalidated by coding error. To find which are invalid you need runs the query below:
<pre class=”brush:sql”>
select object_name
from all_objects
where status = ‘INVALID’
</pre>
Invalid objects will be listed.