-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathawr_lios.sql
executable file
·32 lines (30 loc) · 1.14 KB
/
awr_lios.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
spool awr-lios.lst
set pages 2000
set lines 160
col snapshots format a14
col delta format 999999999999
col delta_nr_waits format 9999999999999
col diff format a26 head "Delta in time_waited_micro"
col lios_per_sec format 99999999999999
col BEGIN_INTERVAL_TIME format a26
col END_INTERVAl_TIME format a26
col avg_wait_scat format 999.999 head "Average Wait (ms)|session logical reads"
select s.begin_interval_time, s.end_interval_time, s.end_interval_time - s.begin_interval_time diff ,b.snap_id||','||e.snap_id snapshots,
e.value - b.value delta ,
round((e.value - b.value)/3600,2) lios_per_sec
from dba_hist_sysstat b,
dba_hist_sysstat e,
dba_hist_snapshot s,
v$database v
where b.snap_id = e.snap_id -1
and e.snap_id > b.snap_id
and b.dbid = v.dbid
and e.dbid = v.dbid
and b.instance_number = 1
and e.instance_number = 1
and b.stat_id = e.stat_id
and e.stat_name in ('session logical reads')
and s.snap_id = e.snap_id
order by 1
/
spool off