Runstats | rebind (db2rbind)


Reorgchk and Reorg


+

Search Tips   |   Advanced Search

The REORG command reorganizes a table by compacting information and reconstructing the rows to eliminate fragmented data. The REORGCHK utility uses different algorithms to find the tables and indexes that need to be reorganized. The REORGCHK command will output a table listing all the table and index objects. An asterisk (*) on the REORG column will indicate that the calculated results exceed the set bounds of its corresponding formula, and that the table might need to be reorganized.

Unless you use the "CURRENT STATISTICS" specifier, the REORGCHK command will update the statistics for all the objects on the database. If you are running REORGCHK after RUNSTATS, you can use the "CURRENT STATISTICS" specifier to avoid updating the statics twice. You can also omit RUNSTATS and have REORGCHK update the statics, but this method provides less flexibility.

Once the tables or indexes to be reorganized have been identified using the REORGCHK command, the REORG command has to be explicitly invoked for each object. DB2 does not offer a way to automatically reorganize all the tables or indexes that were identified by REORGCHK.

Table reorganization is commonly performed in any one of the following ways:

A standard (offline) REORG will lock for write the tables being reorganized. If you need to allow updates to the tables, online table reorganization can be used instead.

Follow the links in the DB2 Information Center for more information about the REORGCHK command and the REORG INDEXES/TABLE command.