OCP 1Z0 053 96

来源:互联网 发布:面向对象编程的优点 编辑:程序博客网 时间:2024/06/01 10:12
96.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 
Answer: C 


http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_3001.htm#SQLRF53314

shrink_clause

The shrink clause lets you manually shrink space in a table, index-organized table or its overflow segment, index, partition, subpartition, LOB segment, materialized view, or materialized view log. This clause is valid only for segments in tablespaces with automatic segment management. By default, Oracle Database compacts the segment, adjusts the high water mark, and releases the recuperated space immediately.

Compacting the segment requires row movement. Therefore, you must enable row movement for the object you want to shrink before specifying this clause. Further, if your application has any rowid-based triggers, you should disable them before issuing this clause.

Note:

Do not attempt to enable row movement for an index-organized table before specifying the shrink_clause. The ROWID of an index-organized table is its primary key, which never changes. Therefore, row movement is neither relevant nor valid for such tables.

COMPACT If you specify COMPACT, then Oracle Database only defragments the segment space and compacts the table rows for subsequent release. The database doesnot readjust the high water mark and does not release the space immediately. You must issue another ALTER TABLE ... SHRINK SPACE statement later to complete the operation. This clause is useful if you want to accomplish the shrink operation in two shorter steps rather than one longer step.

For an index or index-organized table, specifying ALTER [INDEX | TABLE] ... SHRINK SPACE COMPACT is equivalent to specifying ALTER [INDEX | TABLE ... COALESCE. Theshrink_clause can be cascaded (refer to the CASCADE clause, which follows) and compacts the segment more densely than does a coalesce operation, which can improve performance. However, if you do not want to release the unused space, then you can use the appropriate COALESCE clause.


0 0
原创粉丝点击