QuestionQ10

VerifiedManage Database Performance

You want to reduce fragmentation and reclaim unused space for the sales table, but not for its dependent objects. During this operation, you want to ensure the following:

  1. Long-running queries are unaffected.
  2. No additional space is used.
  3. Data manipulation language (DML) operations on the table succeed at all times during the process.
  4. Unused space is reclaimed both above and below the high water mark.

Which ALTER TABLE option would you recommend?

Explanation

SHRINK SPACE COMPACT performs the online data-movement and compaction phase for the table only, so DML and queries can continue while fragmented space below the high water mark is consolidated for reuse. It does not use CASCADE, which would shrink dependent objects, and it does not require the additional segment space associated with table reorganization. The high water mark is not reset and extents are not physically released until a later SHRINK SPACE operation without COMPACT; deferring that phase avoids the short DML block associated with deallocation. Oracle documents COMPACT as specifically useful when long-running queries may span the operation.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!