DBA SGA CPU Load (active session history)

Description
Categories: Enginatics
Repository: Github
Aggregates active sessions by snapshot time to identify times with high CPU load over a specific 'CPU Sessions From' threshold value.
select
xxen_util.client_time(gash.sample_time_) sample_time,
gash.inst_id,
gash.sessions,
xxen_util.zero_to_null(gash.cpu_sessions) cpu_sessions,
xxen_util.zero_to_null(gash.waiting_sessions) waiting_sessions
from
(
select distinct
cast(gash.sample_time as date) sample_time_,
gash.inst_id,
count(*) over (partition by gash.sample_id) sessions,
count(decode(gash.session_state,'ON CPU',1)) over (partition by gash.sample_id) cpu_sessions,
count(decode(gash.session_state,'WAITING',1)) over (partition by gash.sample_id) waiting_sessions
from
gv$active_session_history gash
where
1=1
) gash
where
2=2
order by
sample_time,
inst_id
Parameter NameSQL textValidation
From Time
gash.sample_time>=:from_time
DateTime
To Time
gash.sample_time<:to_time+1/86400
DateTime
CPU Sessions From
gash.cpu_sessions>=:cpu_sessions_from
Number
Session Type
gash.session_type=upper(:session_type)
LOV
Instance Id
gash.inst_id=:inst_id
LOV
Diagnostic Pack enabled
0=0
LOV