Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to determine size(storage) of a table with indexes?

Re: How to determine size(storage) of a table with indexes?

From: Daniel Nichols <daniel.nichols_at_NOSPAMvirgin.net>
Date: Mon, 9 Jun 2003 20:45:20 +0000 (UTC)
Message-ID: <iks9evglpl16l6mu59tj91d25fr9tjthh7@4ax.com>


Use something like the following to get the table with some sample rows in it then multiple it up to your requirements. It's best to do this empirically then use pencil and paper.

SET SERVEROUTPUT ON SIZE 10000 DECLARE

  totalBlocks             NUMBER;
  totalBytes              NUMBER;
  unusedBlocks            NUMBER;
  unusedBytes             NUMBER;
  lastUsedExtentFileID    NUMBER;
  lastUsedExtentBlockID   NUMBER;
  LastUsedBlock           NUMBER;

BEGIN
-- Calculating free space for an object

   dbms_space.unused_space(<SCHEMA>,

                           <TABLE NAME>,
                           'TABLE',
                           totalBlocks,
                           totalBytes,
                           unusedBlocks,
                           unusedBytes,
                           lastUsedExtentFileID,
                           lastUsedExtentBlockID,
                           lastUsedBlock);

  DBMS_OUTPUT.PUT_LINE('Unused Mb=
'||TO_CHAR(unusedBytes/(1024*1024)));

  DBMS_OUTPUT.PUT_LINE('Used Mb= '||TO_CHAR( (totalBytes - unusedBytes)/(1024*1024)));

END;
/

Daniel.

On 6 Jun 2003 15:42:16 -0400, yijin_at_wam.umd.edu (Yi Jin) wrote:

>
>How do one determine the storage requirement of a table,
>together with the associated indexes?
>
>Thanks.
>
>YJ
Received on Mon Jun 09 2003 - 15:45:20 CDT

Original text of this message

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