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;