Sei sulla pagina 1di 1

To find the tablespaces used percentage use the following query.

The following
query will give us tablespaces which are more than 85% used. If you want you can
change the percentage at the end of the statement instead of .85 you can put your
own like .90 or .80 and it will display 90% or 80% used tablespaces.

select trunc(s.bytes/f.maxbytes, 2) used_pct, 'TABLESPACE ' || s.tablespace_name


|| ' is ' || to_char(trunc(s.bytes/f.maxbytes, 2)*100) || '% full' description
from (select tablespace_name, sum(bytes) bytes
from dba_segments
group by tablespace_name) s,
(select tablespace_name, sum(greatest(nvl(maxbytes, 0), bytes)) maxbytes
from dba_data_files
group by tablespace_name) f
where s.tablespace_name = f.tablespace_name
and s.bytes/f.maxbytes >.85;

Potrebbero piacerti anche