| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Querying tablespace size
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
![]() |
![]() |