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 for all tablespaces

RE: Free space for all tablespaces

From: Sandeep Dubey <sandeep.dubey_at_induscorp.com>
Date: Tue, 11 Jul 2000 11:08:41 -0400
Message-Id: <10555.111672@fatcity.com>


Tom:

Try this: It gives freespaces in each datafiles/tablespaces.

select b.file_id,b.tablespace_name "Tablespace Name", b.bytes/(1024*1024) MB, (b.bytes- sum(nvl(a.bytes,0)))/(1024*1024) "MB Used",
sum(nvl(a.bytes,0))/(1024*1024) "MB Free",
(sum(nvl(a.bytes,0))/(b.bytes))*100 "% Free"
from sys.dba_free_space a, sys.dba_data_files b where a.file_id(+) = b.file_id
group by b.tablespace_name,b.file_id, b.bytes order by b.tablespace_name
/

Sandeep Dubey

-----Original Message-----
From: blair_at_pjm.com [mailto:blair_at_pjm.com] Sent: Tuesday, July 11, 2000 9:56 AM
To: Multiple recipients of list ORACLE-L Subject: Free space for all tablespaces

I just want a SQL query to give me the freespace in all tablespaces. This doesn't work:

select a.tablespace_name, sum(a.bytes) TOTAL_SPACE, sum(b.bytes)a FREE_SPACE from sys.dba_data_files a, sys.dba_free_space b where a.tablespace_name = b.tablespace_name group by 1;

Does anyone have a query that does work??

thanks,

..tom

-- 
Author: 
  INET: blair_at_pjm.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Tue Jul 11 2000 - 10:08:41 CDT

Original text of this message

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