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: find free space under HWM for a table

Re: find free space under HWM for a table

From: Vladimir Begun <jester_at_whale.sunbay.crimea.ua>
Date: Thu, 12 Jul 2001 01:18:50 -0700
Message-ID: <F001.00348560.20010712012547@fatcity.com>

On Jul 12, 2001 at 12:10:25AM, Vladimir Begun wrote:
> on Jul 11, 2001 at 11:30:18PM, Chuan Zhang wrote:
> > Hi, DBA gurus,
> >
> > Recently, I will archiving some big tables. How to find free space under
> > HWM for a table?
>
> Do analyze and then you can calculate it:
>
> dba_segments.blocks - dba_tables.empty_blocks - 1
>
> Be aware the blocks which are below HWM can be empty
> because of preallocation or delete activities.

A way to calculate number of really used blocks (for 8+):

SELECT COUNT(DISTINCT

           DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid)
        || DBMS_ROWID.ROWID_RELATIVE_FNO(rowid)
       )

  FROM schema.table;

SELECT COUNT(DISTINCT SUBSTR(rowid, 1, 15)) FROM schema.table;

-- 
Vladimir Begun               | I expect people to expect Perl to do the
http://vbegun.net/           | right thing.
http://vbegun.net/wap/       |       -- Larry Wall in
me_at_vbegun.net                |       <199911192358.PAA24109_at_kiev.wall.org>
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Vladimir Begun
  INET: jester_at_whale.sunbay.crimea.ua

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 Thu Jul 12 2001 - 03:18:50 CDT

Original text of this message

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