Wednesday, November 13, 2013

scripto to check free space on oracle tablespace?

select a.tablespace_name"TBS_NAME" ,
       a.mB Mbytes_used,
       b.mB Mbytes_free,
 round(((a.mB-b.mB)/a.mB)*100,2)"%USED"
from
(select tablespace_name,sum(bytes/1024/1024) mB from dba_data_files group by tablespace_name) a,
(select tablespace_name,sum(bytes/1024/1024) mB from dba_free_space group by tablespace_name) b
where a.tablespace_name=b.tablespace_name order by 4 desc ;

No comments:

Post a Comment