How to REUSE extents efficiently?
You need to consider the REUSE issue globally. The impact is not on the tables
and indexes you create, rather it is the problem of how the other users on the
same tablespace can reuse the released extents after a table or index has been
dropped.
When table or index are dropped (dropping segments) their free extents can be
reused by the other tables or indexes in the same tablespace. However, if these
tables and indexes have different extent-configurations, the free extents
might need to be coalesced to form the right size. For instance, your dropped
table's extent size is 1 MB, and your colleage uses 2 MB as the extent size.
2 of the released extents need to be coalesced to form a 2 MB extent before the
free space can be reused.
All the users on the same tablespace should adopt a policy to use multiples of
Oracle read size as the size of extent. In that way, the released extent can be
re-used when the requirement is of the same size or a fraction of
that size (1/2, 1/3,...).
Notice that Oracle SMON process automatically coalesces extents only when the
PCTINCREASE on the tablespace is set to non-zero. (the problem of non-zero
PCTINCREASE is that the storage space will grow at accelerated rate)
If the PCTINCREASE of the tablespace is set to zero, the tablespace has to be
manually coalesced. (alter tablespace ... coalesce)
The trick is to set the tablespace's PCTINCREASE to 1 (to enable automatic
coalesce), and then use a specific STORAGE clause when the table or index is
created. (to avoid accelerated growth on storage space)
-- the tablespace has a non-zero PCTINCREASE setting
create table test_table (x varchar2(10))
tablespace app_ref storage (initial 1M next 1M pctincrease 0);