oracle高水位(hwmhighwatermark)说明

上传人:xiao****1972 文档编号:84085501 上传时间:2019-03-02 格式:DOC 页数:15 大小:189.50KB
返回 下载 相关 举报
oracle高水位(hwmhighwatermark)说明_第1页
第1页 / 共15页
oracle高水位(hwmhighwatermark)说明_第2页
第2页 / 共15页
oracle高水位(hwmhighwatermark)说明_第3页
第3页 / 共15页
oracle高水位(hwmhighwatermark)说明_第4页
第4页 / 共15页
oracle高水位(hwmhighwatermark)说明_第5页
第5页 / 共15页
点击查看更多>>
资源描述

《oracle高水位(hwmhighwatermark)说明》由会员分享,可在线阅读,更多相关《oracle高水位(hwmhighwatermark)说明(15页珍藏版)》请在金锄头文库上搜索。

1、一. 准备知识:ORACLE的逻辑存储管理.ORACLE在逻辑存储上分4个粒度: 表空间, 段, 区 和 块. 1.1 块: 是粒度最小的存储单位,现在标准的块大小是8K,ORACLE每一次I/O操作也是按块来操作的,也就是说当ORACLE从数据文件读数据时,是读取多少个块,而不是多少行. 每一个Block里可以包含多个row. 1.2 区: 由一系列相邻的块而组成,这也是ORACLE空间分配的基本单位,举个例子来说,当我们创建一个表Dave时,首先ORACLE会分配一区的空间给这个表,随着不断的INSERT数据到Dave,原来的这个区容不下插入的数据时,ORACLE是以区为单位进行扩展的,也

2、就是说再分配多少个区给Dave,而不是多少个块.1.3 段: 是由一系列的区所组成, 一般来说, 当创建一个对象时(表,索引),就会分配一个段给这个对象. 所以从某种意义上来说,段就是某种特定的数据.如CREATE TABLE Dave,这个段就是数据段,而CREATE INDEX ON Dave(NAME), ORACLE同样会分配一个段给这个索引,但这是一个索引段了.查询段的信息可以通过数据字典: SELECT * FROM USER_SEGMENTS来获得.1.4 表空间: 包含段,区及块.表空间的数据物理上储存在其所在的数据文件中.一个数据库至少要有一个表空间.表空间(tableSpa

3、ce) 段(segment) 盘区(extent) 块(block) 关系http:/ ORACLE还是给它分配了8个块. 当然这个跟建表语句的INITIAL 参数及MINEXTENTS参数有关. 如:STORAGE(INITIAL 64KMINEXTENTS 1MAXEXTENTS UNLIMITED); 也就是说,在这个对象创建以后,ORACLE至少给它分配一个区,初始大小是64K,一个标准块的大小是8K,刚好是8个BLOCK. Oracle Table 创建参数 说明http:/ 高水线(High Water Mark)2.1 官网说明如下http:/ manage space, Ora

4、cle Database tracks the state of blocks in the segment. The high water mark (HWM) is the point in a segment beyond which data blocks are unformatted and have never been used.MSSM uses free lists to manage segment space. At table creation, no blocks in the segment are formatted. When a session first

5、inserts rows into the table, the database searches the free list for usable blocks. If the database finds no usable blocks, then it preformats a group of blocks, places them on the free list, and begins inserting data into the blocks. In MSSM, a full table scan reads all blocks below the HWM.ASSM do

6、es not use free lists and so must manage space differently. When a session first inserts data into a table, the database formats a single bitmap block instead of preformatting a group of blocks as in MSSM. The bitmap tracks the state of blocks in the segment, taking the place of the free list. The d

7、atabase uses the bitmap to find free blocks and then formats each block before filling it with data. ASSM spread out inserts among blocks to avoid concurrency issues.Oracle 自动段空间管理(ASSM:auto segment space management)http:/ data block in an ASSM segment is in one of the following states:(1)Above the

8、HWMThese blocks are unformatted and have never been used.(2)Below the HWMThese blocks are in one of the following states:(1)Allocated, but currently unformatted and unused(2)Formatted and contain data(3)Formatted and empty because the data was deletedFigure 12-23 depicts an ASSM segment as a horizon

9、tal series of blocks. At table creation, the HWM is at the beginning of the segment on the left. Because no data has been inserted yet, all blocks in the segment are unformatted and never used.Figure 12-23 HWM at Table Creation Suppose that a transaction inserts rows into the segment. The database m

10、ust allocate a group of blocks to hold the rows. The allocated blocks fall below the HWM. The database formats a bitmap block in this group to hold the metadata, but does not preformat the remaining blocks in the group.In Figure 12-24, the blocks below the HWM are allocated, whereas blocks above the

11、 HWM are neither allocated or formatted. As inserts occur, the database can write to any block with available space. The low high water mark (low HWM) marks the point below which all blocks are known to be formatted because they either contain data or formerly contained data.Figure 12-24 HWM and Low

12、 HWMIn Figure 12-25, the database chooses a block between the HWM and low HWM and writes to it. The database could have just as easily chosen any other block between the HWM and low HWM, or any block below the low HWM that had available space. In Figure 12-25, the blocks to either side of the newly

13、filled block are unformatted.Figure 12-25 HWM and Low HWM The low HWM is important in a full table scan. Because blocks below the HWM are formatted only when used, some blocks could be unformatted, as in Figure 12-25. For this reason, the database reads the bitmap block to obtain the location of the

14、 low HWM. The database reads all blocks up to the low HWM because they are known to be formatted, and then carefully reads only the formatted blocks between the low HWM and the HWM.Assume that a new transaction inserts rows into the table, but the bitmap indicates that insufficient free space exists

15、 under the HWM. In Figure 12-26, the database advances the HWM to the right, allocating a new group of unformatted blocks.Figure 12-26 Advancing HWM and Low HWMWhen the blocks between the HWM and low HWM are full, the HWM advances to the right and the low HWM advances to the location of the old HWM. As the database

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 大杂烩/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号