设为首页 加入收藏

TOP

分析HWM(一)
2015-07-24 11:11:06 来源: 作者: 【 】 浏览:3
Tags:分析 HWM
ORACLE9i之后开始使用自动段空间管理即ASSM,它使用位图来管理段空间的使用情况,如果表空间ASSM,则表空间中的段也是ASSM.

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.
当表创建时,HWM开始于段的最左边。因为从来没有数据插入,所有在段里的块没有被格式化和使用。

Suppose that a transaction inserts rows into the segment. The database must 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 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.
假设一个事务将行插入到段。 数据库必须分配一个组块的行。低于HWM分配的块。这组数据库格式的位图块的元数据,但不预先格式剩下的组块。在图12 - 24中,下面的块HWM分配,而块上面HWM既不分配或格式化。插入时,数据库可以写任何块可用空间。高水标低(低HWM)标志着点下面这所有的块都被格式化的,因为他们要么包含数据或以前包含数据。

In 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 filled block are unformatted.
在图12-25,数据库选择HWM和低HWM和之间的一块写道。数据库也可以轻易选择其他块之间HWM和低HWM,或任何块低于低HWM可用空间。在图12-25,块的新填充块无格式。



The low HWM is important in a full table scan. Because blocks below the HWM arformatted only when used, some blocks could be unformatted, as in Figure 12–25. Fthis reason, the database reads the bitmap block to obtain the location of the low HWM. The database reads all blocks up to the low HWM because they are known tbe 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 under the HWM. In Figure 12–26, the database advances the HWM to the right, allocating a new group of unformatted blocks.
HWM低是重要的在一个全表扫描。因为块低于HWM基于“增大化现实”技术格式化只使用时,一些街区可以无格式,如图12-25所示。F因此,数据库读取位图块获得低的位置HWM。数据库读取所有块的低HWM因为它们是已知的被格式化,然后仔细 阅读只有格式化块之间的低HWM HWM。假设一个新的事务将行插入到表中,但位图显示HWM空闲空间不足存在。图12-26数据库右边的HWM进步,分配一个新组的非格式化块。


When 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 inserts data over time, the HWM continues to advance to the right, with the low HWM always trailing behind it. Unless you manually rebuild, truncate, or shrink the object, the HWM never retreats.
当HWM之间的块和低HWM充满,HWM进步的正确的和低老HWM HWM进步的位置。作为数据库插入数据随着时间的推移,右边的HWM不断进步,HWM偏低总是落后。除非你手动重建、截断或缩小对象,HWM从不撤退。

以上通过官方文档理论的分析了HWM,下面我们通过实验来分析:

[oracle@localhost ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)

SQL> select * from v$version where rownum=1;


BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production


SQL> show user;
USER 为 "HR"
SQL> desc t;

名称 是否为空? 类型
----------------------------------------- -------- ----------------------------
ID NUMBER(38)
NAME VARCHAR2(10)


SQL> select count(*) from t;


COUNT(*
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇hadoop2.2、hbase0.94.18集群安装 下一篇取得一张表的数据不在另一张表中..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·数据库:推荐几款 Re (2025-12-25 12:17:11)
·如何最简单、通俗地 (2025-12-25 12:17:09)
·什么是Redis?为什么 (2025-12-25 12:17:06)
·对于一个想入坑Linux (2025-12-25 11:49:07)
·Linux 怎么读? (2025-12-25 11:49:04)