-
Notifications
You must be signed in to change notification settings - Fork 62
/
jb.sql
executable file
·34 lines (29 loc) · 1.07 KB
/
jb.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
33
select current_obj#, sum(greatest(1,1/time_waited)) as estimated_io_requests,
sum(greatest(1,time_waited)) as estimated_wait_time
from v$active_session_history
where time_waited > 0
and event='db file sequential read'
group by current_obj#
order by 3 desc
/
select current_obj#, 10*sum(greatest(1,1/time_waited)) as estimated_io_requests,
10*sum(greatest(1,time_waited)) as estimated_wait_time,
sum(greatest(1,time_waited))/
sum(greatest(1,1/time_waited)) avg,
avg(time_waited),
max(time_waited),
min(time_waited)
from dba_hist_active_sess_history
where time_waited > 0
and event='db file sequential read'
group by current_obj#
order by 3 desc
/
select current_obj#, 10*sum(greatest(1,1/time_waited)) as estimated_io_requests,
avg(greatest(1,time_waited)) as estimated_wait_time
from dba_hist_active_sess_history
where time_waited > 0
and event='db file sequential read'
group by current_obj#
order by 3 desc
/