2026-03-12 20:23:15

This commit is contained in:
root
2026-03-12 21:23:47 +01:00
parent eab4b36eca
commit 93039b8489
3332 changed files with 699614 additions and 0 deletions

32
mhouri/ashtop20.sql Normal file
View File

@@ -0,0 +1,32 @@
--|-----------------------------------------------------------|
--|Scope : display awr top events and sql |
--|Usage : @aashtop20 "16032021 08:00:00" "16032021 09:00:00"|
--|-----------------------------------------------------------|
set feed off
define from_mmddyy="&1"
define to_mmddyy="&2"
clear break
select decode(event,null, 'on cpu', event) event, count(1)
from gv$active_session_history
where
sample_time between to_date('&from_mmddyy', 'ddmmyyyy hh24:mi:ss')
and to_date('&to_mmddyy', 'ddmmyyyy hh24:mi:ss')
group by event
order by 2 desc
fetch first 20 rows only;
select sql_id, count(1)
from gv$active_session_history
where
sample_time between to_date('&from_mmddyy', 'ddmmyyyy hh24:mi:ss')
and to_date('&to_mmddyy', 'ddmmyyyy hh24:mi:ss')
group by sql_id
order by 2 desc
fetch first 20 rows only;
undefine from_mmddyy
undefine to_mmddyy