Re: Question: formula for calculating initial

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Tue, 7 Sep 1999 09:19:36 +0200
Message-ID: <7r2ebh$8cd$1_at_oceanite.cybercable.fr>


According to the section "Space Estimations for Schema Objects" of the Oracle7 Server Administrator's Guide, you can calculate the available space in a block with the following procedure:

Step 1: Calculate the Total Block Header Size The space required by the data block header is the result of the following formula:

Space after headers (hsize)
=
DB_BLOCK_SIZE - KCBH - UB4 - KTBBH - (INITRANS - 1) * KTBIT - KDBH Where:

DB_BLOCK_ SIZE is the database block size as viewed in the V$PARAMETER view

KCBH, UB4, KTBBH, KTBIT,KDBH are constants whose sizes you can obtain by selecting from entries in the V$TYPE_SIZE view

INITRANS is the initial number of transaction entries allocated to the table

Step 2: Calculate the Available Data Space Per Data Block The space reserved in each data block for data, as specified by PCTFREE, is calculated as follows:

available data space (availspace)
=
CEIL(hsize * (1 - PCTFREE/100)) - KDBT
Where:

CEIL rounds a fractional result to the next highest integer

PCTFREE is the percentage of space reserved for updates in the table

KDBT is a constant whose size you can obtain by selecting the entry from the V$TYPE_SIZE view

Note: If you are unable to locate the value of KDBT, use the value of UB4 instead.

Mangi a écrit dans le message <01bef8ba$6ff3b280$f405bfce_at_default>...
>The first step (next to knowing your block size) is calculating the
>available space in the block for a table. The formula:
>
>avail space in block = (db_block_size - overhead) x (PCTFREE / 100)
>
>Question: If PCTFREE is 10 (def) then aren't we calculating the space
>available in the block for updates only. I thought the point was to
>calculate the total space available in the whole block NOT including the
>space saved for updates? If PCTFREE is 10 then the rest of the block is 90?
>
>
>ex) (4096 - 190) x .9 = 3515 bytes / block
>
> (4096 - 190) x .1 = 390 bytes / block
>
>with the first example I have 24 records / block, the second I have 2
>records / block
>
>I understand what PCTFREE is, just not how (why) we use it here.
>
>Thanks,
>
>Chris G
>
>
>
>
>
Received on Tue Sep 07 1999 - 09:19:36 CEST

Original text of this message