Page 1 of 1

Reorg tables

Posted: Thu Feb 27, 2014 3:17 am
by maidy
Hello People!!

How to know when I need to reorganize tables?
A systems analyst told me that the system performance is poor. And asked me to reorganize tables. How to know which tables should be reorganized without knowing what programs are with the poor performance??

Thanks a lot!! :D

Re: Reorg tables

Posted: Thu Feb 27, 2014 12:21 pm
by Anuj Dhawan
DB2 Tables REORG and performance tuning of programs involved are two different things. Said that, if you're talking about DB2 on z/OS - read about DB2 RUNSTATS Utility.

According to the above link:
Run RUNSTATS to help evaluate the design of the database and determine when the REORG utility should be run for specific table spaces or indexes.
This is another link on RUNSTATS, which gives more explanation about it.

Re: Reorg tables

Posted: Thu Feb 27, 2014 12:46 pm
by zprogrammer
A very good link here to start with REORG

Re: Reorg tables

Posted: Fri Mar 07, 2014 8:09 pm
by Quasar Chunawala
Maidy,

To add here, you not only re-organize tables but also re-organize indexes! As time goes by, insertions and deletions can cause tables, indexes to be dis-organized. In brief, REORG's put table data on the pages in order(clustering sequence). Free-space is reset. DB2 maintains real-time statistics about tables/indexes in SYSTABLESPACESTATS and SYSINDEXSPACESTATS. Explore these.

Thanks,
Quasar C.

Re: Reorg tables

Posted: Tue Mar 11, 2014 10:38 pm
by maidy
Hello Quasar. Thanks for your consideration!

The REORG TABLESPACE command reorganizes all data and all indexes tied to it.

Txs!
Maidy

Re: Reorg tables

Posted: Tue Mar 11, 2014 10:41 pm
by Quasar Chunawala
Yes indeed! Cool. :)