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: Querying tablespace size

Re: Querying tablespace size

From: Mladen Gogala <gogala_at_sbcglobal.net>
Date: Fri, 04 Mar 2005 04:29:02 GMT
Message-ID: <pan.2005.03.04.04.29.01.956110@sbcglobal.net>


On Thu, 03 Mar 2005 16:02:36 -0800, elnegro wrote:

> Hi all,
>
> do you know how can I get the size of all the tablespaces and the free
> space for each one? Obviously through PL/SQL. The main idea is to avoid
> Enterprise Manager. I´m trying to get the same info through PL/SQL.
>
> Thenks,
> Best regards.
> Pablo.

select       fs.tablespace_name as "Tablespace",
             fs.mb as "Free MB",
             ts.mb as "Total MB",
             round(100*fs.mb/ts.mb,2) as "Pct. Free"
      from  (select tablespace_name, round(sum(bytes)/1048576,2) mb
             from dba_free_space
             group by tablespace_name) fs,
            (select tablespace_name,round(sum(bytes)/1048576,2) mb
             from dba_data_files
             group by tablespace_name) ts
where ts.tablespace_name=fs.tablespace_name order by 4

Of course, you can rewrite this as a pl/sql procedure, too.

-- 
A clean tie attracts the soup du jour.
Received on Thu Mar 03 2005 - 22:29:02 CST

Original text of this message

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