Db2 Reorg Table With Indexes
If a table is in reorg pending state an in place reorg is not allowed on the table.
Db2 reorg table with indexes. With db2 v9 7 fix pack 1 and later reorg table commands and reorg indexes all commands can be issued on a data partitioned table to concurrently reorganize different data partitions or partitioned indexes on a partition. With db2 v9 7 fix pack 1 and later reorg table commands and reorg indexes all commands can be issued on a data partitioned table to concurrently reorganize different data partitions or partitioned indexes on a partition. Every index on a table multiplies the cpu cost of each insert or delete operation or the cpu cost of any update that changes the value of an indexed column. Code start db2 reorg table table name code end.
Sample reorg index control statements. Insert a row into a table with three indexes and db2 must add a corresponding entry to an index three times. Reorg table cannot use an index that is based on an index extension. Reorg table cannot be used on a partitioned table in a dms table space while an online backup of any table space in which the table resides including lobs and indexes is being performed.
When concurrently reorganizing data partitions or the partitioned indexes on a partition users can access the unaffected. Unless you are using table partitioning you may only reorg all indexes for a table. On a data partitioned table you can reorganize a. If there s an asterisk in the last column a reorganization is needed.
Effect of reorg index on index version numbers db2 stores the range of used index version numbers in the oldest version and current version columns of the sysibm sysindexes and sysibm sysindexpart catalog tables. The first compromise most people look at is whether they need to reorganise every table or not and make use of db2 catalog statistics to determine which objects to reorg. To reorganize the tables with an asterisk in the last column. When concurrently reorganizing data partitions or the partitioned indexes on a partition users can access the unaffected partitions but cannot access the affected partitions.
The output from reorg index consists of a reorganized index or index partition. In reality what s happening is that the selection is determining which tables indexes do not look like they need reorganising right now. F4 is the only flag in the index section that has the possibility to prompt a table reorg. The other formulas will indicate various kinds of index reorgs.
You can reorganize all indexes that are defined on a table by rebuilding the index data into unfragmented physically contiguous pages. The second section is the indexes.