The defrag parameter of the reorg command lets
you schedule and resume reorganization, while also allowing concurrent reads or writes on
the data being reorganized.
The syntax is:
reorg defrag table_name [partition {partition_list}]
[with {time = hh:mm | resume | skip_compact_extents
[= pct_value]}]
where:
- defrag – reorganizes each partition list or partition in
the table while allowing concurrent reads or writes on the data being
reorganized.
- partition – is the subset of the table that shares the same
column definitions, constraints, and defaults as the table.
- partition_list – is the list of partition names.
- time – reorganizes the table or the list of partitions for the
specified interval of time. hh is the number of hours and has no
limit, and mm is the number of minutes 0–59.
- resume – resumes table reorganization from the end of the last
reorganized data page invoked from the previous reorg defrag.
resume continues until the entire table or list of partitions
is reorganized. Running time =
hh:mm with resume indicates
that you are running reorganization from the previous position of reorganization and
running it only for the specified interval of time.
- with skip_compact_extents – skips compact extents. The
compactness of an extent is measured as the percentage occupancy in that
extent.
- pct_value – is the compactness of an extent measured as the
percentage occupancy in that extent with a value of 1–100.
Compactness =
(Total space occupied in an extent / Total space in an extent) x 100.
If
with skip_compact_extents is used, all the extents with
compactness greater than or equal to the threshold occupancy percent value
specified would be skipped for reorganization. If no threshold percent value is
specified, the default percent value is 80%.