Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

db2 reorganize a table

Tags:

db2

When I alter a table in db2, I have to reorganize it so I execute the next query:

Call Sysproc.admin_cmd ('reorg Table myTable');

I m searching an appropriate solution to reorganize a table when it s altered, or reorganize all the schema after making various modifications

like image 733
senior Avatar asked Apr 16 '13 09:04

senior


1 Answers

You can determine when tables will require a REORG by looking at SYSIBMADM.ADMINTABINFO:

select tabschema, tabname
  from sysibmadm.admintabinfo
 where reorg_pending = 'Y' 

You may also want to look at the NUM_REORG_REC_ALTERS column as this may show you additional tables that don't require reorganization due to various ALTER TABLE statements.

like image 153
Ian Bjorhovde Avatar answered Jan 01 '23 20:01

Ian Bjorhovde