------------------------------------------------------------
-- file ashp.sql
-- desc ASH session level w/wait specific params (min partial event)
-- author Craig A. Shallahamer, craig@orapub.com
-- orig 02-April-07
-- lst upt 02-April-07
-- copyright (c)2007 OraPub, Inc.
-- It is possible to get percentages greater/lesser than 100% because there
-- is a time lag between the total calculations and the report query
------------------------------------------------------------
def sleep_time_min=&1
def partial_event=&2
set echo off
set feedback off
set heading on
set verify off
set termout on
def osm_prog = 'ash.sql'
def osm_title = 'Session Level ASH By Event (last &sleep_time_min min)'
start osmtitle
col event format a38 heading "Wait Event" trunc
select ash.event,
session_id,
p1,p2,p3
from v$active_session_history ash
where ash.sample_time between (sysdate-&sleep_time_min/(60*24)) and sysdate
and event like '%&partial_event%'
order by event,p1,p2,p3,session_id
/
start osmclear