developerworks > My developerWorks >  Dashboard > DB2 wiki > DB2 wiki > Real world DB2 tips, troubleshooting, and general advice

View Info

Real world DB2 tips, troubleshooting, and general advice

This section of the DB2 wiki contains information, advice, and tips about DB2 taken from real DB2 user experience.  Many of these items where originally posted on our DB2 Express-C forum

We encourage you to participate, if you have a comment on something or have some information of your own to add, just add a comment on this document and we will take a look.  Anyone can add comments as long as you are logged in with your IBM ID.  (And if you don't have an IBM ID, it takes minutes to sign-up, and don't worry, you can keep your email address hidden.)

This document is under construction.

Resources


Comments

sreese says:

Source code to my db2_runstats.ksh for AIX

#!/usr/bin/sh

for i in `db2 list db directory|grep -ip Indirect|grep name|grep Database| awk '

Unknown macro: {print $4}
'`
do
echo 'DBname = ' $i
db2 connect to $i
db2 -x "select 'runstats on table '  || rtrim(TABSCHEMA) || '.' || TABNAME  ||  ' WITH DISTRIBUTION AND DETAILED indexes all shrlevel change' from syscat.tables where type='T'" > runstats.temp
      if [ "$?" -eq 1 ];then
         echo "No tables for database $DBname"
         continue
      fi
      while read line_by_line
      do
       db2 +v $
Unknown macro: {line_by_line}

      done < runstats.temp
#     rm runstats.temp
done
echo Runstats ended at `date`

helton Reese
     
      DB2 Support, Xtivia  Virtual DBA Services
      IBM Software Services for Information Management
      312-635-0198 mobile/office/fax
      sreese@xtivia.com
      sreese@aol.com
      sreese@us.ibm.com
                                     #####
       #####   #####   #         #           ####    #      #   #####   #####     ####   #####   ######
       #        #  #        #            #          #            #       #  #        #  #        #  #       #   #       #       #
       #        #  #####   #####            ####    #       #  #        #  #        #  #        #  #       #        #
       #        #  #       # #                              #   #       #  #####    #####   #        #  ####          #
       #        #  #       # #                     #      #    #       # #             #             #       #  #      #         #
       #####   #####  ####### ##  #####   ####   #             #               ###     #       #        #
        


Browse Space
- Pages
- Labels
- Attachments
- Mail
- News
- Advanced

Explore Confluence
- Popular Labels
- Notation Guide

Your Account
Log In

 

Other Features

View a printable version of the current page.

Add Content


Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.3.3 Build:#645 Feb 13, 2007)
Bug/feature request - Contact Administrators