3. While observing the index statistics, you find that an index is highly fragmented, thereby resulting in
poor database performance. Which option would you use to reduce fragmentation without affecting the
users who are currently using the index?
A.Validate the index structure using the ANALYZE...INDEX command.
B.Rebuild the index using the ALTER INDEX..REBUILD ONLINE command.
C.Change the block space utilization parameters using the ALTER INDEX command.
D.Deallocate the unused space in the index using the ALTER INDEX..DEALLOCATE UNUSED command.
Answer: B
答案解析:
通过重建不可用索引来重算指针,可使不可用索引变为有效。重建不可用索引会在新位置重新创建索引,然后会删除不可用索引。如使用一下语句来重建索引
ALTER INDEX HR.emp_empid_pk REBUILD ONLINE;
使用REBUILD ONLINE子句,用户可以在重建时继续更新索引表。