set linesize 160;
set pagesize 40;
col tablespace_name for a20;
col file_name for a50;
select t.tablespace_name,
t.file_id,
t.file_name,
autoextensible,
round(decode(t.autoextensible, 'YES', t.maxbytes, 'NO', bytes) / 1024 / 1024,
2) MaxMB,
round(t.bytes / 1024 / 1024, 2) totalMB,
round(nvl(f.fbytes, 0) / 1024 / 1024, 2) freeMB,
round((t.bytes - nvl(f.fbytes, 0)) / 1024 / 1024, 2) usedMB,
round((t.bytes - nvl(f.fbytes, 0)) * 100 / t.bytes, 2) PCT_USED
from dba_data_files t,
(select file_id, sum(bytes) fbytes
from dba_free_space
group by file_id) f
where t.file_id = f.file_id(+)
order by tablespace_name, file_id;
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29898569/viewspace-1760176/
,如需转载,请注明出处,否则将追究法律责任。