Lesson 9 | Oracle Free Space |
Objective | How does Oracle uses free space within data blocks? |
PCTFREE
PCTFREE
parameter. PCTFREE
specifies the percentage of a data block reserved for future updates. If you set a PCTFREE
of 20 when Oracle went to insert a new row into the block, the block would only be filled to 80% of its capacity. If the insert required that the block be filled to a greater percentage, Oracle would move on to the next data block for the insert. The default value for PCTFREE
is 10, so if you dont specify a PCTFREE
for a database object, Oracle will use data blocks for inserts up to 90% of their capacity.
PCTUSED
parameter, the block is placed back onto the freelist. You can specify more than one freelist for a table. Because Oracle must check the freelist for each insert into a table, you can have multiple freelists if your usage scenario calls for frequent simultaneous inserts.
Multiple freelists can avoid any potential contention for the freelist contents.
SQL> alter index test_idx1 coalesce; Index altered. SQL>
PCTUSED
PCTFREE
threshold is reached, Oracle stops considering a data block for further insertions. PCTUSED
parameter tells Oracle to begin inserting rows into a block if the overall space usage within the
block drops to a certain level. If you set the PCTUSED
parameter to 40, as soon as deletions left a block with only 39% of its space used, Oracle would begin inserting rows into the block again.
PCTFREE
and PCTUSED
parameters is to step through
the following series of images below.