Reorg table DB2

19 June,2011 by Tom Collins

Reorg table DB2

Step 1

run reorgchk:


------CODE START---------------
db2 reorgchk update statistics on table all > output.out
------CODE END------------------

Running the command this way will run across all tables rather than RUNSTATS across every table.
The reorgchk update statistics report has two sections; the first section is the table information and
the second section is the indexes. If there's an asterisk in the last column a reorganization is needed.
To reorganize the tables with an asterisk in the last column:


-------CODE START----------------
db2 reorg table table_name 
-------CODE END------------------

where table_name is the name of the table to be reorganized; for example, MYDB.MYTABLE.
Generally speaking, because most data in databases  is accessed by index, reorganizing tables is usually not as beneficial as reorganizing indexes.

To reorganize the indexes with an asterisk in the last column


----------CODE START-------------------
db2 reorg table table_name index index_name
----------CODE END---------------------

where table_name is the name of the table; for example, MYDB.MYTABLE
index_name is the name of the index

Run reorgchk again. The output from reorgchk can then be used to determine whether the reorganization worked and whether it introduced other tables and indexes that need reorganizing.

Reorg table DB2 is straightforward but, If it's a production database , run the db2 reorg procedure at a low activity time. Reorg table DB2 can be a resource intensive procedure

Related Posts

How to monitor a DB2 REORG - DBA DB2

DB2 Used Space and REORG - DBA DB2

DB2 table reorg and table truncate - DBA DB2

Author: Rambler(


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on Reorg table DB2

Comments are moderated, and will not appear until the author has approved them. | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright