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

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

    Re: RUNSTATS for Schema

    ‏2010-10-01T13:41:34Z  
    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

    Re: RUNSTATS for Schema

    ‏2011-05-18T07:36:11Z  
    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.
    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