全部博文(45)
分类: Oracle
2010-10-15 09:55:32
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.
COMPACT If you specify COMPACT
, then Oracle Database only defragments the segment space and compacts the table rows for subsequent release. The database does not 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
. The shrink_clause
can be cascaded (please 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.
CASCADE If you specify CASCADE
, then Oracle Database performs the same operations on all dependent objects of table
, including secondary indexes on index-organized tables.
chinaunix网友2010-12-29 20:24:36
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com