Like any other object, the data
dictionary manages space allocation to a tablespace.
That means Oracle updates the appropriate tables
in the data dictionary whenever an extent is allocated
or freed for reuse. Oracle also stores rollback
information about each update of the dictionary
tables. Because dictionary tables and rollback segments
are part of the database, the space that they occupy
is subject to the same space management operations
as all other data. This method of space management
is called extent management by the data dictionary.
These tablespaces are also called as Dictionary
managed tablespaces. This was the only option available
prior to release 8.1. In Oracle release 8.1 and
above you have an option to manage the space allocation
called extent management by the tablespace
Locally Managed Tablespaces
A tablespace that can manage extent
allocation by itself is called locally managed tablespace.
These tablespaces maintain a bitmap in each datafile
to keep track of the freed or used status of blocks
in that datafile. Each bit in the bitmap corresponds
to a block or a group of blocks. When an extent
is allocated or freed for reuse, Oracle changes
the bitmap values to show the new status of the
blocks. These changes do not generate rollback information
because they do not update tables in the data dictionary
(except for special cases such as tablespace quota
information).
Extent Allocation
Locally managed tablespaces can
have uniform extent sizes or variable extent sizes
that are determined by the system. Any of the options,
UNIFORM or AUTOALLOCATE can be mentioned while creating
the tablespace. For UNIFORM extents you can specify
an extent size. The default size is 1MB. For AUTOALLOCATE
extents you can specify the size of the initial
extent and Oracle determines the optimal size of
the additional extents, with a minimum extent size
of 64KB. That is why these are called system-managed
extents.
How Extents are Allocated
Oracle looks for free space to
allocate to a new extent by first determining a
candidate datafile in the tablespace and then searching
the datafile's bitmap for the required number of
adjacent free blocks. If that datafile does not
have enough adjacent free space, Oracle looks in
another datafile. When extents are deallocated,
Oracle modifies the bitmap in the datafile.