forked from khailey-zz/ashmasters
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiotbs.sql
More file actions
executable file
·33 lines (31 loc) · 746 Bytes
/
Copy pathiotbs.sql
File metadata and controls
executable file
·33 lines (31 loc) · 746 Bytes
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
col block_type for a18
col objn for a25
col otype for a15
col event for a25
col blockn for 999999
col p1 for 9999
col aas for 999.99
col f_minutes new_value v_minutes
select &minutes f_minutes from dual;
select io.cnt,
round(io.cnt/(&v_minutes*60),2) aas,
io.event,
io.p1 p1,
f.tablespace_name
from (
select
count(*) cnt,
substr(event,0,25) event,
ash.p1 p1
from v$active_session_history ash
where ( event like 'db file s%' or event like 'direct%' )
and sample_time > sysdate - &v_minutes/(60*24)
group by
event ,
ash.p1
) io,
dba_data_files f
where
f.file_id = io.p1
Order by io.cnt
/