Oracle Logbook

June 6, 2008

Find free space on tablespace x Allocated space %

Filed under: Uncategorized — Helio Dias @ 5:10 pm

Today i answered this question on OTN,

select * from (
Select tbs2,free_space,allocated,trunc((free_space/allocated)*100) pct_free from
(select tablespace_name tbs1,sum(bytes)/1024/1024 free_space from dba_free_space
group by tablespace_name),
(select tablespace_name tbs2,sum(bytes)/1024/1024 allocated from dba_data_files
group by tablespace_name)
where tbs2=tbs1(+) ) where pct_free <&min_pct
and TBS2 not in
(select tablespace_name from dba_TABLESPACES where contents=’UNDO’)
order by 3;

Create a free website or blog at WordPress.com.