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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Free Space per tablespace....

Re: Free Space per tablespace....

From: Rahul Dandekar <orcldba_at_hotmail.com>
Date: Tue, 5 Dec 2000 12:30:01 -0500
Message-Id: <10701.123686@fatcity.com>


How about doing it in single sql without views... No doubt that this method is correct and I used very similar stuff to get it done. But which way can it be done by simple single sql....

-Rahul

> Create or replace view free_space_view as
> Select t.tablespace_name, nvl(sum(f.bytes),0) free
> From dba_tablespaces t, dba_free_space f
> Where t.tablespace_name = f.tablespace_name(+)
> Group by t.tablespace_name
> /
>
> Create or replace view used_space_view as
> Select t.tablespace_name, nvl(sum(e.bytes),0) used
> From dba_tablespaces t, dba_extents e
> Where t.tablespace_name = e.tablespace_name(+)
> Group by t.tablespace_name
> /
>
> Select f.tablespace_name "Tablespace"
> , to_char(f.free/1048576, '999,999,999')||'Mb' "Free Mb"
> , to_char(u.used/1048576, '999,999,999')||'Mb' "Used Mb"
> , to_char(f.free/1048576 + u.used/1048576, '999,999,999') || 'Mb'
> "Total Mb"
> From free_space_view f, used_space_view u
> Where f.tablespace_name = u.tablespace_name
> /
>
> "Out of my mind...Back in five minutes."
>
> Christopher R. Spence
> OCP Raptor MCSE MCP A+ CNA
> Oracle Database Administrator
> Fuel Spot
>
> 73 Princeton Road
> Suite 207
> North Chelmsford, MA 01863
Received on Tue Dec 05 2000 - 11:30:01 CST

Original text of this message

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