Script to check free space and used space in Oracle Database tablespaces

select a.tablespace_name,
       a.bytes_alloc/(1024*1024) “TOTAL ALLOC (MB)”,
 a.physical_bytes/(1024*1024) “TOTAL PHYS ALLOC (MB)”,
       nvl(b.tot_used,0)/(1024*1024) “USED (MB)”,
       (nvl(b.tot_used,0)/a.bytes_alloc)*100 “% USED”
from ( select tablespace_name,
       sum(bytes) physical_bytes,
sum(decode(autoextensible,’NO’,bytes,’YES’,maxbytes)) bytes_alloc
       from dba_data_files
       group by tablespace_name ) a,
     ( select tablespace_name, sum(bytes) tot_used
       from dba_segments
group by tablespace_name ) b
where a.tablespace_name = b.tablespace_name (+)
–and   (nvl(b.tot_used,0)/a.bytes_alloc)*100 > 10
and   a.tablespace_name not in (select distinct tablespace_name from dba_temp_files)
and   a.tablespace_name not like ‘UNDO%’
order by 1
 –order by 5

36 thoughts on “Script to check free space and used space in Oracle Database tablespaces”

  1. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
    You definitely know what youre talking about, why waste your intelligence on just posting videos to your
    blog when you could be giving us something enlightening to
    read?

    Here is my website: nordvpn coupons inspiresensation (in.mt)

  2. Why visitors still make use of to read news papers when in this technological world everything is existing on net?

    My webpage; vpn

  3. That is very interesting, You are an excessively skilled blogger.
    I’ve joined your feed and look forward to seeking extra of your wonderful post.
    Also, I’ve shared your site in my social networks

  4. I’ve been surfing online more than 3 hours nowadays, yet I by no means discovered
    any attention-grabbing article like yours. It’s pretty value
    enough for me. In my opinion, if all website owners and bloggers made just
    right content as you probably did, the web can be much more helpful than ever before.

  5. After exploring a few of the blog articles on your site, I seriously like your technique of blogging. I book-marked it to my bookmark webpage list and will be checking back soon. Take a look at my website as well and let me know what you think.

Leave a Reply

Your email address will not be published. Required fields are marked *