Monthly Archive: June 2016

Jun 06

Generating DB2 RUNSTATS SQL

This SQL will generate a set of RUNSTATS commands for the tables in your database that have no RUNSTATS values recorded. select ‘CALL SYSPROC.ADMIN_CMD(”RUNSTATS ON TABLE ‘|| trim(tabschema) || ‘.’ || tabname || ‘ ON ALL COLUMNS AND INDEXES ALL ALLOW READ ACCESS”);’ from syscat.tables where stats_time is null and tabschema not like ‘SYS%’ order …

Continue reading »