Active session history analyze


  SELECT   TO_CHAR (sample_time, 'hh24:mi'), COUNT ( * )
    FROM    V$ACTIVE_SESSION_HISTORY
   WHERE   event = 'db file scattered read'
           AND sample_time > SYSDATE - 600 / 1440
GROUP BY   TO_CHAR (sample_time, 'hh24:mi');
_______________________________________________________
  SELECT   p1, COUNT ( * )
    FROM   V$ACTIVE_SESSION_HISTORY
   WHERE   event = 'library cache: mutex X'
           AND sample_time > SYSDATE - 30 / 1440
GROUP BY   p1
ORDER BY   2 DESC;
_______________________________________________________
  SELECT   COUNT ( * ), sql_id
    FROM   V$ACTIVE_SESSION_HISTORY
   WHERE   event = 'library cache: mutex X'
           AND sample_time > SYSDATE - 30 / 1440
GROUP BY   sql_id
ORDER BY   1 DESC;
_______________________________________________________
  SELECT   TO_CHAR (sample_time, 'dd/mm/yyyy hh24:mi'), COUNT ( * )
    FROM   dba_hist_active_SESS_HISTORY
   WHERE   event = 'library cache: mutex X' AND sample_time > SYSDATE - 1
GROUP BY   TO_CHAR (sample_time, 'dd/mm/yyyy hh24:mi');
________________________________________________________
  SELECT sql_id, COUNT (*)
    FROM V$ACTIVE_SESSION_HISTORY
   WHERE sample_time > SYSDATE - 3 / 24 AND event = 'db file scattered read'
GROUP BY sql_id
ORDER BY COUNT (*) DESC;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: