We\'re getting this error once a day on a script that runs every two hours, but at different times of the day.
ERROR at line 1:
ORA-04068: existing state of
It seems that you are making changes to your objects that make other objects invalid. Droping an index for example can put into an invalid state all the packages that dependes on that table. It can have a cascade efect. If the package is invalid, the funciton that depends on the package and the view that uses the function can become invalid. Try to recompile all the objects after every DDL query.