在"什么是未格式化的块"这篇文章里,我们举了一个ASSM里的HHWM下的未格式化的块的实例。
不知道有没有朋友有这样的疑问----为什么HHWM下会出现未格式化的块?
以下的一张图和随后的文字就说明了一切:
ASSM segments have up to three levels of bitmap blocks, a segment header, and the associated data blocks. The diagram above illustrates the relationship between the different block types. The bitmap blocks are structured in a tree hierarchy, with the segment header block considered to be the root of the hierarchy. All searches for space begin with addressing the segment header (and possibly a level 3 bitmap block), then traversing down the hierarchy to the level 2 bitmap block, and then to the level 1 bitmap blocks that indicate the data blocks with available space.
A process that is performing inserts follows the data block address (DBA) to the appropriate data block from the level 1 bitmap block. A range of blocks is formatted at the time of the first insert into the data block. A range is a maximum of 16 blocks and the first process to detect an unformatted block formats the entire range containing that block. The allocation to a L1 bitmap block for multiple concurrent processes performing inserts, is done by means of a hashing algorithm. This attempts to spread the cost of formatting data blocks over several inserting processes. When multiple processes, allocated to different L1 bitmap blocks, require more space, they will format the first range of data blocks that they come across in the bitmap blocks. This naturally leads to "holes" in the segment with some blocks below the high-water mark remaining unformatted.
Unformatted blocks in the middle of the segment are supported for the following reasons:
1、Multiple concurrent processes can write into the same extent, causing block formatting to occur on a process basis. When a process requires more space, the added blocks are linked to that process's bitmap block, potentially leaving unformatted blocks under the HHWM.
2、Extent trimming during direct loads causes unformatted blocks to exist below the HHWM if the entire extent is not used.
The clients of space management layer are concerned only about the HHWM. The unformatted blocks in the middle of the extents appear to them as multiple extents with contiguous formatted blocks.
Formatting the data blocks below the HHWM is performed under the following circumstances:
1、During search for space, if blocks are found unformatted, then format a range of blocks.
2、When extents are allocated, format the first range of blocks in the bitmap blocks.
I was looking for this diagram long time which is very explanatory but I have two questions.
Is the l3 bitmap block at the beginning within the segment header?
Where is the extent map header located?
Thank you in advance,
kostas
Sorry for late reply. I have been to take care of my daughter this weekend. There is no time to surf on the net. When you see the following text, you will understand the answer to your two questions.
A bitmap block is always at the beginning of an extent. For the first extent of a segment, all the bitmap blocks are placed ahead of the segment header to facilitate efficient segment merging. If an extent is larger in size than what an L1 BMB can represent then the Oracle server allocates multiple BMBs at the beginning of the extent. At extent allocation time, all the BMBs (L1, L2, and L3 as needed) are preallocated and placed at the beginning of the extent.
If allocation of extent map block requires the allocation of BMBs, the bitmap blocks
always precede the extent map block in order. Thus, the bitmap at the beginning of the extent represents the blocks in the extent map that immediately follow it, that is, it can represent blocks for multiple extents. However, the Oracle server does not require a bitmap block per extent, as that would mean too many BMBs, potentially resulting in performance problems.
Ensuring that the BMBs precede the segment header or the extent map blocks, allows for the efficient movement of extents in segment merge operations, without unnecessary BMB updates.
Thank you for your answer.
What's the meaning of an extent map purpose however of an extent map since we have BMB blocks which already cover many extents as you mentioned.
Do we have always an extent map for every table or only if we allocate more extents except the initial allocation during table creation? (
I checked the buffer touch counts for the staging table in my application and I noticed that extent map is not loaded in the buffer cache. I am wondering why ..
I follow your blog (the English notes) which is excellent
Warm Regards,
khair
very busy these days, I will write an article to explain the extent map block later.
Kostas, you can see my answers to your latest questions in the following address:
http://dbsnake.com/2009/09/about-emb.html