Topic
1 reply Latest Post - ‏2012-07-27T13:20:27Z by SystemAdmin
SystemAdmin
SystemAdmin
5837 Posts
ACCEPTED ANSWER

Pinned topic Find table that need REORG

‏2012-07-27T12:27:22Z |
I'm using
SELECT TABSCHEMA, TABNAME FROM SYSIBMADM.ADMINTABINFO WHERE REORG_PENDING = 'Y' WITH UR
to find tables that need REORG.
This SQL works fine, except it runs for about 5 minuts on a database with couple of thousend tables.

Is there a faster way to get tables that need REORG?

Best regards,
Kovi
Updated on 2012-07-27T13:20:27Z at 2012-07-27T13:20:27Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5837 Posts
    ACCEPTED ANSWER

    Re: Find table that need REORG

    ‏2012-07-27T13:20:27Z  in response to SystemAdmin
    Hello Kovi,

    Tables in Reorg Pending State cannot be accessed before a REORG is performed: this happens for example when you drop a column. Many other tables might need a Reorg even if they are not in Reorg Pending State.

    The command reorgchk which checks the need for a reorg. You can also let DB2 handle this automatically by means of Automatic Maintenance.

    http://pic.dhe.ibm.com/infocenter/db2luw/v10r1/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.dbobj.doc%2Fdoc%2Fc0021757.html

    Regards

    Yves-Antoine Emmanuelli