title: Frequent error in Oracle ORA-04068: existing state of packages has been discarded
body: <p>We're getting this error once a day on a script that runs every two hours, but at different times of the day.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Could someone list what conditions can cause this error so that we could investigate?</p>
  
  <p>Thanks.</p>
  
  <p>UPDATE:
   Would executing <code>'ALTER SESSION CLOSE  DATABASE LINK DBLINK'</code> invalidate a state of the package?</p>