Below is the most complete tablespace script I have found. I think you will
like it.
set pagesize 80 linesize 100 feedback off
column tablespace_name heading Tablespace format a19
column object_count heading 'Objects|(#)' format 999990
column mb heading Mb format 9990
column sum(frags) heading 'Frags|(#)' format 9999
column avail heading 'Max|(Mb)' format 9999.99
column free heading 'Free|(%)' format 999.9
column bytesize heading 'Size|(Mb)' format 9999999
column byteused heading 'Used|(Mb)' format 9999990
column bytefree heading 'Free|(Mb)' format 9999999
column init_ext heading 'Initial|(K)' format 999999
column next_ext heading 'Next|(K)' format 999999
break on report
compute sum of object_count bytesize byteused bytefree on report
select tablespace_name,
sum(obj_cnt) object_count,
sum(ini_ext) init_ext,
sum(nex_ext) next_ext,
sum(byte)/1048576 bytesize,
(sum(byte)/1048576)- (sum(fbyte)/1048576) byteused,
sum(fbyte)/1048576 bytefree,
sum(frags),
sum(largest)/1048576 avail,
(sum(fbyte)/sum(byte))*100 free
from
(select tablespace_name,
0 obj_cnt,
0 ini_ext,
0 nex_ext,
0 byte,
sum(bytes) fbyte,
count(*) frags,
max(bytes) largest
from dba_free_space
group by tablespace_name
union
select tablespace_name,
0, 0, 0, sum(bytes), 0, 0, 0
from dba_data_files
group by tablespace_name
union
select tablespace_name, 0,
initial_extent/1024 ini_ext,
next_extent/1024 nex_ext,
0,0,0,0
from dba_tablespaces
union
select tablespace_name,
count(*) obj_cnt,
0, 0, 0, 0, 0, 0
from dba_segments
group by tablespace_name)
group by tablespace_name
order by free desc;
set pagesize 24 feedback on verify on
-----Original Message-----
Sent: Tuesday, May 01, 2001 1:41 PM
To: Multiple recipients of list ORACLE-L
Here is one that I use. I do not count the TEMP tablespace and the RBS
tablespace because these vary in size.
SELECT sum(bytes) DB_SIZE from dba_segments
where tablespace_name not in ('RBS','TMP')
You can do more math if you do not want the answer in bytes.
Regards,
Ruth
----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
Sent: Tuesday, May 01, 2001 2:11 PM
> Hi All,
>
> Oracle 8.0.5 NT 4
> Does anyone have a script they would share that can calculate the ACTUAL
> size of a database(space_used) not what has been allocated?
>
> Thanks
> Rick
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Cale, Rick T (Richard)
> INET: [EMAIL PROTECTED]
>
> 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: [EMAIL PROTECTED] (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).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Ruth Gramolini
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Smith, Ron L.
INET: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] (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).