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: object size?

Re: object size?

From: diversif <diversif_at_ix.netcom.com>
Date: 1997/02/06
Message-ID: <01bc1466$9b25d9a0$6398b8cd@PHUBER>#1/1

If you:

           select bytes 
           from user_segments 
           where segment_name = {table_name} and 
                     segment_type = 'TABLE';
   You will get the number of bytes that is allocated to the table. When you create a table (with minextents 1) the number of bytes returned from the above query will be the size of your initial extent. (or close to it, there is some rounding to blocks and nearest 5 blocks depending on the number of blocks you requested as an initial). At this point, the table is empty.

If you want to see how much of the allocated space is used, you can run:

           analyze table { table_name} compute statistics; and check the blocks column on the user_tables view and multiply this by you blocksize -

     OR
           select count(distinct(substr(rowid,1,8))||substr(rowid,15,4)) 
           from {table_name};

    and multiply this by your block size. The last two will give you an approximate amount of space used by the table, this is only the number of blocks that have at least 1 record in them.

Obviously this will be effected by the values of PCTFREE...,

ptsao_at_sequeltech.com wrote in article <32F91188.3B9_at_sequeltech.com>...
> Hi, All,
>
> How can I figure out the size of an object? for example,a table's size.
>
> I tried to get some info out of user_object_size and dba_extents
> but it seems to me those are not the right place.
> dba_extents seems to only give info on physical allocation. The size
> info does not change when objects get dropped.
> For a table, user_object_size gives some number on parsed_size which
> I don't have a clue whatsoever.
>
> Thanks,
>
> Phil Tsao
>
Received on Thu Feb 06 1997 - 00:00:00 CST

Original text of this message

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