Wednesday, February 27, 2008

ASH - Active Session History

Unlike AWR, the collection of session performance statistics is in-memory every second.
Can be queried from V$ACTIVE_SESSION_HISTORY view

MMON flushes the ASH buffer to AWR DBA_HIST_ACTIVE_SESS_HISTORY

To find out how many sessions waited for some event,
select session_id||','||session_serial# SID, n.name, wait_time, time_waited 
from v$active_session_history a, v$event_name n
where n.event# = a.event#
  • CURRENT_OBJ#, can then be joined with DBA_OBJECTS to get the segments in question
  • SQL_ID, can be joined with V$SQL to get SQL Statement that caused the wait
  • CLIENT_ID, which was set for any client application session using DBMS_SESSION.SET_IDENTIFIER may be used to identify the client.

No comments: