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: <8jb0lf$rfn$1@nnrp1.deja.com>#1/1

Thanks for the tip Tom, I changed mine to use dba_free_space and converted to KB, really zips now.

select
tablespace_name,

sum(total_kb)-sum(free_kb) current_kb,
sum(total_kb) total_kb,
sum(max_kb) max_kb,

trunc(decode(sum(max_kb), 0, (sum(total_kb)-sum(free_kb))/sum
(total_kb), (sum(total_kb)-sum(free_kb))/sum(max_kb))*100) percentage
from
(

select
tablespace_name,
sum(bytes)/1024 free_kb,
0 total_kb,
0 max_kb
from
dba_free_space
group by
tablespace_name
union
select
tablespace_name,
0 current_kb,
sum(bytes)/1024 total_kb,
sum(maxbytes)/1024 max_kb
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