Reorganizing dbspaces and tables to eliminate extent interleaving

You can rebuild a dbspace to eliminate interleaved extents so that the extents for each table are contiguous.

About this task

The order of the reorganized tables within the dbspace is not important, but the pages of each reorganized table should be contiguous so that no lengthy seeks are required to read the table sequentially. When the disk arm reads a table nonsequentially, it ranges only over the space that table occupies.

Figure 1: A dbspace reorganized to eliminate interleaved extents

This figure shows contiguous extents for three tables.

Procedure

To reorganize tables in a dbspace:

  1. For DB-Access users: Copy the tables in the dbspace individually to tape with the UNLOAD statement in DB-Access.
  2. Drop all the tables in the dbspace.
  3. Re-create the tables with the LOAD statement or the dbload utility.

Results

The LOAD statement re-creates the tables with the same properties they had before, including the same extent sizes.

You can also unload a table with the onunload utility and reload the table with the companion onload utility.