column FileNum format 999 heading 'File|Num'
column FileName format A60 heading 'File Name'
column Tablespace format A30 heading 'Tblspace'
column Allocated format 9,999 heading 'Size|(MB)'
column div1 format A3 heading ' | '
column Used format 9,999 heading 'Used|(MB)'
column Pct_Used format 999.99 heading 'Used|(%)'
column div2 format A3 heading ' | '
column TotalFree format 9,999 heading 'Free|(MB)'
column Pct_Free format 999.99 heading 'Free|(%)'
column MaxFree format 9,999 heading 'MaxFree'
column status format A3 heading 'STA'
column oneMB noprint new_value MB
compute sum of Allocated on tablespace
compute sum of Allocated on report
compute sum of Used on tablespace
compute sum of Used on report
compute sum of TotalFree on tablespace
compute sum of TotalFree on report
select substr(to_char(x.file_id,999), 1,4) FileNum,
x.file_name FileName,
x.tablespace_name Tablespace,
x.bytes/(1024*1024) Allocated,
(x.bytes-sum(y.bytes))/(1024*1024) Used,
substr(x.status,1,3) status
from sys.dba_data_files x ,
sys.dba_free_space y
where x.file_id = y.file_id
group by substr(to_char(x.file_id,999), 1,4),
x.file_name,
x.tablespace_name,
x.bytes,
x.status
order by 1,2,3;
Tags:
Oracle