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.
|
Browse Space |
Explore Confluence |
Your Account |
Add Content |
|
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.3.3 Build:#645 Feb 13, 2007) |
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 '
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 $
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
#####
##### ##### # # #### # # ##### ##### #### ##### ######
# # # # # # # # # # # # # # # # #
# # ##### ##### #### # # # # # # # # # # #
# # # # # # # # ##### ##### # # #### #
# # # # # # # # # # # # # # # #
##### ##### ####### ## ##### #### # # ### # # #