AWR Query: Count of Sessions (and display it in an Excel chart)
Execute this query in SQL Developer
select
cast(any_value(sample_time) as date) - date '1899-12-30' sample_time_xls, -- See converting an Oracle DATE to an Excel serial number
count(*) cnt,
count(*) - count(event) cnt_on_cpu
from
dba_hist_active_sess_history
where
dbid = (select dbid from v$database)
group by
sample_id,
dbid
having
any_value(sample_time) between trunc(sysdate-4) and trunc(sysdate-3)
order by
any_value(sample_time)