Before rebuilding an existing index, compare the costs and benefits associated with
rebuilding to those associated with coalescing indexes as described in Table 16–1 on
page 16-5.
在重建一个已存在索引前,比较成本和益处关于重建到这些相关的合并索引(描述在表16-1上)
When you rebuild an index, you use an existing index as the data source. Creating an
index in this manner enables you to change storage characteristics or move to a new
tablespace. Rebuilding an index based on an existing data source removes intra-block
fragmentation. Compared to dropping the index and using the CREATE INDEX
statement, re-creating an existing index offers better performance.
The following statement rebuilds the existing index emp_name:
当你重建一个索引,你使用已经存在索引作为数据源,创建一个索引通过这个办法允许你去改变存储规格参数
或者移动到一个新的表空间。重建一个索引基于已经存在数据源删除内部的碎片块,重建一个已经存在索引
提供了更好的性能。
以下的语句重建一个已经存在的索引EMP_NAME;
ALTER INDEX emp_name REBUILD;
The REBUILD clause must immediately follow the index name, and precede any other
options. It cannot be used in conjunction with the DEALLOCATE UNUSED clause.
You have the option of rebuilding the index online. Rebuilding online enables you to
update base tables at the same time that you are rebuilding. The following statement
rebuilds the emp_name index online:
REBUILD语句必须直接地跟从索引名,和任何其它选项前。它不能使用在联合DEALLOCATE UNUSED 语句。
你可以可选地在线创建索引。在线重建允许你去更新基本表在你正在创建的时刻。以下的语句在线重建索引
EMP_NAME.
ALTER INDEX emp_name REBUILD ONLINE;
Note: Online index rebuilding has stricter limitations on the
maximum key length that can be handled, compared to other methods
of rebuilding an index. If an ORA-1450 (maximum key length
exceeded) error occurs when rebuilding online, try rebuilding offline,
coalescing, or dropping and recreating the index.
备注:在线索引的重建有严格地限制在被处理的最大化主键长度,对比于其它重建索引的方法。如果一个ORA-1450
(最大主键长度超出范围)错误发生当你在线重建,尝试离线重建,合并,或者删除和重建索引。
If you do not have the space required to rebuild an index, you can choose instead to
coalesce the index. Coalescing an index is an online operation.
如果你没有重建索引需要的空间,你可以选择合并索引来取代,合并索引是一个在线的操作。