Results 1 to 2 of 2
  1. #1
    Join Date
    May 2015
    Location
    Korea
    Posts
    50

    Unanswered: DB2 Script for reorg, runstats

    Good?

    db2 "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname ),1,50),' and indexes all;'from syscat.tables where type = 'T' "
    db2 "select 'reorg table',substr(rtrim(tabschema)||'.'||rtrim(tabname ),1,50),';'from syscat.tables where type = 'T' "
    Last edited by StellaZhang; 07-15-16 at 20:59.

  2. #2
    Join Date
    Apr 2012
    Posts
    1,006
    Provided Answers: 16
    Those scripts are too simplistic. No error handling, no recovery, no use of runstats-profiles, no support for MQT or long table-names. Maybe you need to think carefully why you don't want to use the automnomic features (auto_runstats, auto_reorg etc). For many applications these autonomic features are 'good enough'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •