Hi all,
I am trying to find out how to calculate the sqlarea "retention time".
I know that the sqlarea is used in a cyclic fashion: when an object is not used by any session it will fall down in a LRU list and eventually it will be purged out of the sqlarea. This can happen after some seconds or after some hours, depending on many different circumstances (sga size, db load type, use of bind variables, ...).
I would like to periodically calculate my sqlarea "retention time" to see how long I am caching unused corsors, just to check from a different perspective how my db is behaving.
According to the v$sqlarea reference ( http://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3064.htm#REFRN30259 ), V$SQLAREA.LAST_ACTIVE_TIME is the "Time at which the query plan was last active".
That seems to meet my requirement, because I would expect " SYSDATE - MIN ( V$SQLAREA.LAST_ACTIVE_TIME ) " to be my sqlarea actual "retention time".
Unfortunatly, if I look for the oldest values of LAST_ACTIVE_TIME I found a few rows with LAST_ACTIVE_TIME="01/01/1970 01:00:00" AND a few rows with LAST_ACTIVE_TIME ~ one months ago (checked on different 11gR2 instances).
That's weird and that seems to break the LRU rule.
Do you know how can we approximate the sqlarea retention time?
Thanks
Andrea