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: Need SQL Example

RE: Need SQL Example

From: Post, Ethan <epost_at_kcc.com>
Date: Tue, 24 Jul 2001 14:22:00 -0700
Message-ID: <F001.00353DA3.20010724142601@fatcity.com>

Thanks for the SQL all. Here is the result. You can change and use this with DBA_FREE_SPACE also if your not using uniform extent sizes to help determine level of fragmentation.

select tablespace_name,

       count(*) f_count,
       sum(decode(sign(round(bytes/1024) - 64), 1, 0, 1)) f_below_64kb,
       sum(decode(sign(round(bytes/1024) - 129) * sign(round(bytes/1024) -
64), -1, 1, 0)) f_65k_128kb,
                 sum(decode(sign(round(bytes/1024) - 501) *
sign(round(bytes/1024) - 128), -1, 1, 0)) f_129k_500kb,
                 sum(decode(sign(round(bytes/1024) - 1025) *
sign(round(bytes/1024) - 500), -1, 1, 0)) f_501kb_1mb,
                 sum(decode(sign(round(bytes/1024) - 10241) *
sign(round(bytes/1024) - 1024), -1, 1, 0)) f_1025kb_10mb,
                 sum(decode(sign(round(bytes/1024) - 999999999999) *
sign(round(bytes/1024) - 10240), -1, 1, 0)) f_above_10mb,
                 round(max(bytes/1024)) f_max_kb,
                 round(avg(bytes/1024)) f_avg_kb
from
       dba_segments
where
       segment_type = 'TABLE'
group by
       tablespace_name;


------------------------------------------------------------------------------
This e-mail is intended for the use of the addressee(s) only and may contain privileged, confidential, or proprietary information that is exempt from disclosure under law. If you have received this message in error, please inform us promptly by reply e-mail, then delete the e-mail and destroy any printed copy. Thank you.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Post, Ethan
  INET: epost_at_kcc.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 24 2001 - 16:22:00 CDT

Original text of this message

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