detecting user sessions with invalid/lost state
This will result in "ORA-04068: existing state of packages has been discarded" the next time they try to access that package.
All good so far.
What I want to do though, is pre-empt these messages and target only those user sessions that have lost that state, so I can get the sessions restarted and prevent them getting the error further down the line.
Is there a query or view that tells me which user sessions have stale/invalid state?