Db2 reorganize table

When I modify a table in db2 , I need to reorganize it so I execute the following query:

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

I am looking for a suitable solution to reorganize a table when it changes or to reorganize the whole scheme after making various changes.

+5
source share
3 answers

The reorg operation is like defragmenting your hard drive. It frees up empty pages, and ultimately it can reorganize the data according to the index. Depending on the functions, it creates a compression dictionary and compresses the data.

As you can see, the reorganization operation is an administrative task, and it is not needed every time the data is changed. The database can work without reorg.

, DB2 , , . reorg , .

+3

, REORG, SYSIBMADM.ADMINTABINFO:

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

NUM_REORG_REC_ALTERS, , - ALTER TABLE.

+3

in db2 configuration:

Auto Reorganization (AUTO_REORG) = OFF

we can set auto_reorg to

0
source

All Articles