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;

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: