Home > Oracle > List tablespaces short of free space

List tablespaces short of free space

Autoextend enabled and maxsize must be set


select a.tablespace_name,
b.Sumbytes/1024/1024 Total_Mbytes,
b.Maxbytes/1024/1024 Max_Mbytes,
nvl(a.Freebytes/1024/1024,0) Free_Mbytes
from
(select tablespace_name,sum(bytes) Freebytes from dba_free_space group by tablespace_name) a,
(select tablespace_name,sum(bytes) Sumbytes, sum(decode (AUTOEXTENSIBLE,'YES',MAXBYTES,BYTES)) Maxbytes from dba_data_files group by tablespace_name ) b
where
a.tablespace_name(+)=b.tablespace_name
and
0.9*b.Maxbytes<b.Sumbytes-nvl(a.Freebytes,0)
/

Advertisements
Categories: Oracle
  1. March 14, 2010 at 9:22 am

    Good fill someone in on and this fill someone in on helped me alot in my college assignement. Thanks you seeking your information.

  1. No trackbacks yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: