col used(MB) for a12
col free(MB) for a12
col total(MB) for a12
col PER_FREE for a12
select F.tablespace_name,to_char((T.total_space-F.free_space),'999,999,999') "used(MB)",
to_char(F.free_space,'999,999,999') "free(MB)",to_char(T.total_space,'999,999,999') "total(MB)",
to_char((round((F.free_space/T.total_space)*100)),'999')|| '%' PER_FREE
from (select tablespace_name,
round(sum(blocks*(select value/1024 from v$parameter where name='db_block_size')/1024))
free_space from dba_free_space group by tablespace_name ) F,
(select tablespace_name,round(sum(bytes/1048576)) total_space
from dba_data_files group by tablespace_name) T
where F.tablespace_name =T.tablespace_name;
沒有留言:
張貼留言