IBM Support

IC75276: CALLING REORGCHK_TB_STATS ON AN EMPTY TABLE WITH STATISTICS COLLECTED RETURNS -1 FOR ALL THE STATISTICS OUTPUTS

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • If a table  is empty but has statistics collected, the
    administrative SQL routine REORGCHK_TB_STATS will return values
    -1 for all the output columns in the result set.
    
    For example, the issue can be reproduces as below:
    
    --create an empty table TEST1 and collect statistics using
    runstats
    db2 "create table db2inst1.TEST1(c1 varchar(10))"
    db2 "runstats on table db2inst1.TEST1"
    
    --use the below query to show the correct statistics for the
    table
    db2 "select
    tabname,type,card,npages,fpages,active_blocks,overflow,
    stats_time from syscat.tables where tabname='TEST1'"
    
    TABNAME
    
    TYPE CARD                 NPAGES               FPAGES
       ACTIVE_BLOCKS        OVERFLOW             STATS_TIME
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ---- -------------------- --------------------
    -------------------- -------------------- --------------------
    --------------------------
    TEST1
    
    T                       0                    0
     1                    0                    0
    2011-01-05-00.29.01.217425
    
      1 record(s) selected.
    
    
    --But the SQL routine SYSPROC.REORGCHK_TB_STATS returns -1 for
    all the statistics columns in the result set.
    
     db2 "CALL SYSPROC.REORGCHK_TB_STATS('T','DB2INST1.TEST1')"
    
    
      Result set 1
      --------------
    
      TABLE_SCHEMA
    
     TABLE_NAME
    
    DATAPARTITIONNAME
    
    CARD                 OVERFLOW             NPAGES
    FPAGES               ACTIVE_BLOCKS        TSIZE
    F1          F2          F3          REORG
    
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    ----------------------------------------------------------------
    -------------------- -------------------- --------------------
    -------------------- -------------------- --------------------
    ----------- ----------- ----------- -----
      DB2INST1
    
     TEST1
    
    -
    
                     -1                   -1                   -1
                   -1                   -1                   -1
        -1          -1          -1 ---
    
      1 record(s) selected.
    
      Return Status = 0
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * ALL                                                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * See Error Description                                        *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Upgrade to DB2 Version 9.7 Fix Pack 5 or newer               *
    ****************************************************************
    

Problem conclusion

  • Problem was first fixed in Version 9.7 Fix Pack 5
    

Temporary fix

Comments

APAR Information

  • APAR number

    IC75276

  • Reported component name

    DB2 FOR LUW

  • Reported component ID

    DB2FORLUW

  • Reported release

    970

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-03-25

  • Closed date

    2012-01-02

  • Last modified date

    2012-01-02

  • APAR is sysrouted FROM one or more of the following:

    IZ91621

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    DB2 FOR LUW

  • Fixed component ID

    DB2FORLUW

Applicable component levels

  • R970 PSN

       UP



Document information

More support for: DB2 for Linux, UNIX and Windows

Software version: 9.7

Reference #: IC75276

Modified date: 02 January 2012