##  DBA Command Post - io.sql


break on Brk  skip 1 on report
column  brk    noprint    
column  name   format a46
column  Reads  format 99999990
column  Writes format 99999990
column  R_Perc format 999.0
column  W_Perc format 999.0

compute sum of Reads  on report 
compute sum of Writes on report

select substr(F.file_name,1,instr(F.file_name,'/',-1)) Brk,
       replace(F.file_name,'.dbf','') name, 
       S.phyblkrd  Reads,  round((S.phyblkrd  / R.value) * 100,1) R_Perc,
       S.phyblkwrt Writes, round((S.phyblkwrt / W.value) * 100,1) W_Perc
from   sys.v_$filestat S,
       sys.v_$sysstat R,
       sys.v_$sysstat W,
       sys.dba_data_files F
where  F.file_id = S.file# (+)
and    R.name = 'physical reads'
and    W.name = 'physical writes'
order  by 1
/
select substr(F.file_name,1,instr(F.file_name,'/',-1)) name,
       sum(S.phyblkrd)  Reads,  
       round((sum(S.phyblkrd) / min(R.value) ) * 100,1) R_Perc,
       sum(S.phyblkwrt) Writes, 
       round((sum(S.phyblkwrt) / min(W.value) ) * 100,1) W_Perc
from   sys.v_$filestat S,
       sys.v_$sysstat R,
       sys.v_$sysstat W,
       sys.dba_data_files F
where  F.file_id = S.file# (+)
and    R.name = 'physical reads'
and    W.name = 'physical writes'
group  by substr(F.file_name,1,instr(F.file_name,'/',-1))
order  by 1
/
select F.tablespace_name name,
       sum(S.phyblkrd)  Reads,  
       round((sum(S.phyblkrd) / min(R.value) ) * 100,1) R_Perc,
       sum(S.phyblkwrt) Writes, 
       round((sum(S.phyblkwrt) / min(W.value) ) * 100,1) W_Perc
from   sys.v_$filestat S,
       sys.v_$sysstat R,
       sys.v_$sysstat W,
       sys.dba_data_files F
where  F.file_id = S.file# (+)
and    R.name = 'physical reads'
and    W.name = 'physical writes'
group  F.tablespace_name
order  by 1
/
	