If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Need help to create script for update stats

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-23-12, 18:25
iam_hari iam_hari is offline
Registered User
 
Join Date: Jul 2011
Posts: 8
Need help to create script for update stats

Hi,

I need to create one script for update stats.

Keeping the below points in consideration.

Could any one help please.

Identify tables/indexes/packages etc that should have stats and don’t
1. List tables/indexes/package without stats
a. That aren’t volatile
b. That aren’t temporary
2. List tables/indexes that automatic stats is disabled on…

Identify tables/indexes that have stale stats
1. List tables/indexes with stale stats
a. Age of stats – probably each table / index should have updated statistics say every 6 weeks?
b. Where the IUD counter indicates they should be scheduled
2. Where the frequency of IUD activity is significant prior to the schedule statistical run
3. Where bulk loads etc are performed
4. Packages that haven’t had stats run on them when their tables have been.

Identify tables / indexes with inappropriate statistical profiles
1. List stats that use a non-automatic stats profile
2. Packages that use static sql verses dynamic sql (ie statistics bound during compilation)

Operational performance
1. Automatic statistics enabled
2. Minutes to run statistics per object
3. check that there hasn’t been an operational issue during run stats eg for DB2
a. SQL2314W Some statistics are in an inconsistent state
b. STAT_HEAP_SZ is too small

It will be grateful. Thanks a lot in advance.
Reply With Quote
  #2 (permalink)  
Old 01-24-12, 02:45
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
a lot of questions
stats_time is available in catalog to check the last runstats
loads are not registered in db - only entry in diag.log
you could create a table (as we do) with table-schema-interval-last stats... to control the fix interval between stats.. pctfree can be changed if interval is too small
other cols in catalog could be monitored - as overflow....
some doc in ic
Using RUNSTATS - IBM DB2 9.7 for Linux, UNIX, and Windows
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On