Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Free space by tablespace script, quality control check.

Re: Free space by tablespace script, quality control check.

From: Ethan Post <epost1_at_my-deja.com>
Date: 2000/06/27
Message-ID: <8jbe6u$6am$1@nnrp1.deja.com>#1/1

For anybody who cares there was a bug in the script, here is fixed version.


select
tablespace_name,

round(sum(total_mb)-sum(free_mb)) cur_use_mb,
round(sum(total_mb)) cur_sz_mb,
round((sum(total_mb)-sum(free_mb))/sum(total_mb)*100) cur_percent_full,
round(sum(max_mb) - (sum(total_mb)-sum(free_mb))) free_space_mb,
round(sum(max_mb)) max_sz_mb,
round((sum(total_mb)-sum(free_mb))/sum(max_mb)*100) overall_percent_full
from
(
select
tablespace_name,
sum(bytes)/1024/1024 free_mb,
0 total_mb,
0 max_mb
from
dba_free_space
group by
tablespace_name
union
select
tablespace_name,
0 current_mb,
sum(bytes)/1024/1024 total_mb,
sum(decode(maxbytes, 0, bytes, maxbytes))/1024/1024 max_mb from
dba_data_files
group by
tablespace_name)
group by
tablespace_name;

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Jun 27 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US