19 June,2011 by Tom Collins
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
How to monitor a DB2 REORG - DBA DB2
This is only a preview. Your comment has not yet been posted.
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.
Posted by: |