187 Examine the following command: SQL> ALTER TABLE booking SHRINK SPACE COMPACT; Which activity is

187
Examine the following command:
SQL> ALTER TABLE booking SHRINK SPACE COMPACT;
Which activity is performed when the preceding command is executed?
A. The shrink operation touches every block in the BOOKING table
B. The high-water mark (HWM) for the BOOKING table is shifted from its original position
C. The progress of the shrink operation is saved in the bitmap blocks of the BOOKING table
D. The data manipulation language (DML) triggers on the BOOKING table are executed because the

shrink operation is internally handled by the INSERT/DELETE operation











Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
http://www.oracle-base.com/articles/10g/SpaceObjectTransactionManagement10g.php
Based on the recommendations from the segment advisor you can recover space from specific objects
using one of the variations of the ALTER TABLE … SHRINK SPACE commands.
The shrink is accomplished by moving rows between blocks, hence the requirement for row movement to
be enabled for the shrink to take place. This can cause problem with ROWID based triggers. The shrinking
process is only available for objects in tablespaces with automatic segment-space management enabled.
The COMPACT option allows the shrink operation to be broken into two stages. First the rows are moved
using the COMPACT option but the HWM is not adjusted so no parsed SQL statements are invalidated.
The HWM can be adjusted at a later date by reissuing the statement without the COMPACT option. At this
point any depenedant SQL statements will need to be reparsed.
http://books.google.com/books?id=0iwrL9P25Z0C&pg=PA190&lpg=PA190&dq=shrink+operation+is
+saved+in+the+bitmap
+blocks&source=bl&ots=MGoTq9AT0m&sig=y0EgXfO2MZnWlOZTgKXo5CDbFJw&hl=en&ei=L0gATdqaN
sG1nAfsrZjlDQ&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCcQ6AEwAw#v=onepage&q=shrink
%20operation%20is%20saved%20in%20the%20bitmap%20blocks&f=false
A shrink operation may cause ROWIDs to change in heap-organized segments. So row movement has to
be enabled to circumvent this issue before a shrink operation. To enable row movement, use the
{CREATE|ALTER} TABLE ENABLE ROW movement command.
A shrink operation consists of thw phases, compaction and adjusting the HWM to release the unused
space. If the COMPACT option is used, only the first phase is executed. The shrink results are saved in
bitmap blocks of the corresponding segment, Oracle 10g will remember what has been done. If CASCADE
is specified, the shrinking cascades to all dependent segments that support a shrink operation.
During the COMPACT phase, individual rowlocks are held. Concurrent DML operations serialize on thes
rowlocks and DML operations can block the compaction progress. When the HWM is adjusted in the
second phase, the object is locked in exclusive mode for a short duration.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值