How to check free space and busy for each tablespace.


How to check free space and busy for each tablespace.

set linesize 300
set pagesize 300
select tbs, sum(Gigas_total) Gigas_total, sum(Gigas_libres)  Gigas_libres, trunc(((sum(Gigas_total) - sum(Gigas_libres)) / sum(Gigas_total)) * 100,2) Porcentaje_ocupado
from (select tablespace_name   tbs, sum (bytes)/1024/1024/1024 Gigas_total, 0 Gigas_libres
from dba_data_files
 group by tablespace_name
 union
select tablespace_name       tbs, 0   Gigas_total, sum(bytes)/1024/1024/1024  Gigas_libres
from dba_free_space
group by tablespace_name )
group by tbs
order by 4 desc
/


Comments