Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Dictionary Managed and auto-coalesce -- was RE: locally
Extents are coalesced in DD managed tablespaces only as needed.
Allocating Extents in Dictionary-Managed Tablespaces
In dictionary-managed tablespaces, Oracle controls the allocation of
incremental extents for a given segment as follows:
1. Oracle searches through the free space (in the tablespace that contains
the segment) for the first free, contiguous set of data blocks of an
incremental extent's size or larger, using the following algorithm:
a. Oracle searches for a contiguous set of data blocks that matches the size
of new extent plus one block to reduce internal fragmentation. (The size
is rounded up to the size of the minimal extent for that tablespace, if
necessary.) For example, if a new extent requires 19 data blocks, Oracle
searches for exactly 20 contiguous data blocks. If the new extent is 5 or
fewer blocks, Oracle does not add an extra block to the request.
b. If an exact match is not found, Oracle then searches for a set of
contiguous data blocks greater than the amount needed. If Oracle finds a
group of contiguous blocks that is at least 5 blocks greater than the size
of the extent needed, it splits the group of blocks into separate extents,
one of which is the size it needs. If Oracle finds a group of blocks that
is larger than the size it needs, but less than 5 blocks larger, it
allocates all the contiguous blocks to the new extent.
In the current example, if Oracle does not find a set of exactly 20
contiguous data blocks, Oracle searches for a set of contiguous data
blocks greater than 20. If the first set it finds contains 25 or more
blocks, it breaks the blocks up and allocates 20 of them to the new extent
and leaves the remaining 5 or more blocks as free space. Otherwise, it
allocates all of the blocks (between 21 and 24) to the new extent.
c. If Oracle does not find an equal or larger set of contiguous data blocks,
it coalesces any free, adjacent data blocks in the corresponding
tablespace to form larger sets of contiguous data blocks. (The SMON
background process also periodically coalesces adjacent free space.) After
coalescing a tablespace's data blocks, Oracle performs the searches
described in 1a and 1b again.
d. If an extent cannot be allocated after the second search, Oracle tries to
resize the files by autoextension. If Oracle cannot resize the files, it
returns an error.
2. Once Oracle finds and allocates the necessary free space in the
tablespace, it allocates a portion of the free space that corresponds to
the size of the incremental extent. If Oracle found a larger amount of
free space than was required for the extent, Oracle leaves the remainder
as free space (no smaller than 5 contiguous blocks).
3. Oracle updates the segment header and data dictionary to show that a new
extent has been allocated and that the allocated space is no longer free.
The blocks of a newly allocated extent, although they were free, may not
be empty of old data. Usually, Oracle formats the blocks of a newly
allocated extent when it starts using the extent, but only as needed
(starting with the blocks on the segment free list). In a few cases,
however, such as when a database administrator forces allocation of an
incremental extent with the ALLOCATE EXTENT clause of an ALTER TABLE or
ALTER CLUSTER statement, Oracle formats the extent's blocks when it
allocates the extent.
"Daniel W. Fink" <optimaldba_at_YAHOO.COM>
Sent by: root_at_fatcity.com
04/17/2003 10:31 PM
Please respond to ORACLE-L
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: Subject: Re: Dictionary Managed and auto-coalesce -- was RE: locally
IIRC, any operation that required allocation of a new extent would perform a coalesce.
-- Daniel W. Fink http://www.optimaldba.com IOUG-A Live! April 27 - May 1, 2003 Orlando, FL Thursday, May 1 1:00pm - 2:00pm - Automatic Undo Internals Hemant K Chitale wrote:Received on Fri Apr 18 2003 - 12:57:33 CDT
>
> In a Dictionary-Managed tablespace [the "good old days" that Rachel is
> talking about],
> SMON would auto-coalesce free extents in the background if PCTINCREASE
> was > 0.
> However, even where PCTINCREASE=0, a CREATE TABLE would still coalesce
> contigous extents. Of course, if the CREATE statement could find
> a Free Extent equal to or larger than the required size, it would use
> such
> extent [breaking up the larger into a used and a free extent]. The
> CREATE
> would coalesce only if it couldn't find an equal or larger extent.
>
> Hemant
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Daniel W. Fink INET: optimaldba_at_yahoo.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: INET: Jared.Still_at_radisys.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
![]() |
![]() |