nerdexam
Oracle

1Z0-052 · Question #60

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…

The correct answer is B. Rebuild the index using the ALTER INDEX ..... REBUILD ONLINE command. ALTER INDEX ... REBUILD ONLINE compacts and defragments an index by rebuilding it while allowing concurrent DML and queries, avoiding impact to active users. It is the correct choice when online availability is required.

Managing Schema Objects

Question

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?

Options

  • AValidate the index structure using the ANALYZE .... INDEX command
  • BRebuild the index using the ALTER INDEX ..... REBUILD ONLINE command
  • CChange the block space utilization parameters using the ALTER INDEX command
  • DDeallocate the unused space in the index using the ALTER INDEX ... DEALLOCATE UNUSED command

How the community answered

(18 responses)
  • A
    6% (1)
  • B
    78% (14)
  • C
    11% (2)
  • D
    6% (1)

Why each option

ALTER INDEX ... REBUILD ONLINE compacts and defragments an index by rebuilding it while allowing concurrent DML and queries, avoiding impact to active users. It is the correct choice when online availability is required.

AValidate the index structure using the ANALYZE .... INDEX command

ANALYZE INDEX ... VALIDATE STRUCTURE inspects the index for corruption and gathers statistics but does not reorganize or compact the index blocks to reduce fragmentation.

BRebuild the index using the ALTER INDEX ..... REBUILD ONLINE commandCorrect

The ONLINE clause of ALTER INDEX ... REBUILD causes Oracle to maintain a journal of DML changes occurring during the rebuild and apply them at the end, so the existing index remains accessible throughout the operation. This removes fragmentation by creating a new, compacted index segment and then atomically replacing the old one, improving performance without blocking user access.

CChange the block space utilization parameters using the ALTER INDEX command

Changing block space utilization parameters such as PCTFREE with ALTER INDEX affects future space allocation but does not rebuild existing fragmented blocks.

DDeallocate the unused space in the index using the ALTER INDEX ... DEALLOCATE UNUSED command

ALTER INDEX ... DEALLOCATE UNUSED releases space above the index high-water mark back to the tablespace but does not consolidate fragmented leaf blocks within the used portion of the index.

Concept tested: Online index rebuild to eliminate fragmentation

Source: https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/ALTER-INDEX.html

Topics

#index fragmentation#ALTER INDEX REBUILD ONLINE#index maintenance#online operations

Community Discussion

No community discussion yet for this question.

Full 1Z0-052 Practice