Active Session History
Oracle Database 10g has upgraded its
v$session view to include wait events and their durations.
However, this view
has the values in real time and does not keep track of
information to be viewed later. Active Session History (ASH), is
very much like AWR, and stores the session performance
statistics in a buffer for analysis later. Unlike AWR storage in
a table, ASH storage is in memory viewable from
v$active_session_history. The data on active sessions is
polled every second and the older entries are removed from
memory to accommodate the latest ones in a circular manner.
The following query is an example
of how to get session
information along with time waited on events:
select
session_id||' - '||session_serial# SID, v$event_name.name,
wait_time, time_waited
from v$active_session_history , v$event_name
SEE CODE DEPOT FOR FULL SCRIPT
The above script
provides the name of
the event and time spent in waiting. A sample portion of the
lengthy output is as follows: