Index online operation的过程 zt

在create index online, alter index rebuild online时,oracle是怎么工作的?


http://www.oracle.com/technology/deploy/availability/htdocs/online_ops.html

Online Index Operations

Oracle provides the capability to perform online index creation. During an online index create operation, concurrent queries and updates are allowed on the base table. During an online index creation operation, changes are recorded in a temporary journal table. At the end of index creation, the journal is merged into the new index. There are three phases in an online index create operation:

Prepare phase: locks are acquired on the table briefly to create the index structure and place entries in the data dictionary.

Build phase: most work is done in this phase where the index is populated. While the build phase occurs, changes to the table are placed in the journal table. The journal table is automatically created and structured as a B-tree so that multiple operations on the same table data can be easily detected and resolved to the latest change.

Merge phase: rows in the journal table are iterratively merged into the index. Most of the merge operation occurs while the table is still online. As journal rows are merged, they are deleted if they are not locked. During the merge phase, edits to the base table will continue to be tracked in the journal table. If changes to the journal continue to occur before the merge process can complete, Oracle will make additional passes through the journal. If after a few passes, the merge is still not complete, Oracle will lock the table briefly and apply the remainder of the journal. The entire process is transparent to the users and upon completion, the new index is brought online.

Index Rebuild (Move)

Oracle supports online index rebuilding. During an online index rebuild operation, concurrent queries and updates are allowed on the base table. The index rebuild operation requires additional disk space during the build process for the newly created index, but the resulting rebuilt index may be more space efficient. Hence the operation is likely to free up additional disk space.

The algorithm for online index rebuild is similar to that of online index creation, and the same basic phases are executed. During an online index rebuild operation, changes are recorded in a temporary journal table. At the end of index rebuild, the journal is merged into the new rebuilt index.

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/82387/viewspace-1016306/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/82387/viewspace-1016306/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值