Topic
2 replies Latest Post - ‏2011-05-18T07:36:11Z by SystemAdmin
amehboob
amehboob
1 Post
ACCEPTED ANSWER

Pinned topic RUNSTATS for Schema

‏2010-07-21T22:10:41Z |
Hello,
Is there any possibility to perform RUNSTATS on all tables within a SCHEMA?
How to implement it with Shell Scripting?

Best Regards
Adnan
Updated on 2011-05-18T07:36:11Z at 2011-05-18T07:36:11Z by SystemAdmin
  • santosh_linux
    santosh_linux
    4 Posts
    ACCEPTED ANSWER

    Re: RUNSTATS for Schema

    ‏2010-10-01T13:41:34Z  in response to amehboob
    Here documents in shell scripting should help.
    If you still have issue you can please give me commands how you run , i can show you how to implement in script.
    • SystemAdmin
      SystemAdmin
      232 Posts
      ACCEPTED ANSWER

      Re: RUNSTATS for Schema

      ‏2011-05-18T07:36:11Z  in response to santosh_linux
      Here's an example. Obviously, you need to modify it to accomodate your requirement e.g. runstats options, whether you need to use userid and passsword to connect to db etc.

      db2 connect to <dbname>
      db2 -x "select substr(tabname,1,30) from syscat.tables where tabschema = '<schema_name>'" | while read tabname
      do
      db2 -v runstats on table schema_name.${table_name}
      done