Monitoring a table reorganization

You can use the GET SNAPSHOT command, the SNAPTAB_REORG administrative view, or the SNAP_GET_TAB_REORG table function to obtain information about the status of your table reorganization operations.

Procedure

  • To access information about reorganization operations using SQL, use the SNAPTAB_REORG administrative view.
    For example, the following query returns details about table reorganization operations on all database partitions for the currently connected database. If no tables have been reorganized, no rows are returned.
       select
           substr(tabname, 1, 15) as tab_name,
           substr(tabschema, 1, 15) as tab_schema,
           reorg_phase,
           substr(reorg_type, 1, 20) as reorg_type,
           reorg_status,
           reorg_completion,
           dbpartitionnum
         from sysibmadm.snaptab_reorg
         order by dbpartitionnum
  • To access information about reorganization operations using the snapshot monitor, use the GET SNAPSHOT FOR TABLES command and examine the values of the table reorganization monitor elements.

Results

Because offline table reorg operations are synchronous, errors are returned to the caller of the utility (an application or the command line processor). And because online table reorg operations are asynchronous, error messages in this case are not returned to the CLP. To view SQL error messages that are returned during an online table reorg operation, use the LIST HISTORY REORG command.

An online table reorg operation runs in the background as the db2Reorg process. This process continues running even if the calling application terminates its database connection.