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 > Where are IDX scan couters in DB2 ??

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-08-10, 14:06
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Where are IDX scan couters in DB2 ??

Hello Friends,

To analyze which indexes are being used, I need to check how many index scans were run on a given index. That means how many times an index had been used in past 24 hours.

Can someone help me find data for an index and maybe if possible about a table too.

Regards
Reply With Quote
  #2 (permalink)  
Old 06-08-10, 14:27
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Which DB2 version and OS?

Andy
Reply With Quote
  #3 (permalink)  
Old 06-08-10, 14:37
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
DB2v9.5.5 on Win2K3
Reply With Quote
  #4 (permalink)  
Old 06-08-10, 14:45
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Reply With Quote
  #5 (permalink)  
Old 06-08-10, 14:52
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Alright,

So db2pd can be run periodically.

Thanks for help
Reply With Quote
  #6 (permalink)  
Old 06-09-10, 09:34
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
As much as your heart desires but I would only run it before deactivating db/cycling the instance. which ever comes first. That is assuming you do it on a regular intervals for house cleaning. If not, you are going to see data there from the last time one of those events took place.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #7 (permalink)  
Old 06-09-10, 09:39
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Well,
I am writing a script for daily checks. At the begining of each day. I guess I should keep a record for about 7 days or so; to review daily ; for a look on the trend.

Regards
Reply With Quote
  #8 (permalink)  
Old 06-09-10, 10:07
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
You are going to be wasting your and others time. This is not something you check on a daily or even weekly basis. I would venture to say that this is something that you want to check on a quarterly basis unless you are creating new indexes and implementing new projects on a daily basis.
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #9 (permalink)  
Old 06-09-10, 10:37
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Agree,

I just had a discussion; we are not going to set up a daily job for this. May be once a while , or when my manager wants to have a look on details.

Regards for good suggestion
Reply With Quote
  #10 (permalink)  
Old 06-09-10, 11:01
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
I have decided to take another look at it and possibly finally write something up that will take a manual work out of the picture, if it all possible.

I would be curious to compare the notes and see how you are going about it and maybe put a collective together to get this done.

What I have found out thus far is for some unknown reason IBM did not extended fields for tbname, schema on the output and if you are on a 9 what ever your tables most likely been extended past 18 char point.

This makes it a bit tricky to get a correct info out. In the index section it only gives you a chopped tbname and an IID of the index. So, to identify the correct index you have to cross match hex value from an index section to a hex value on the table section to get a correct tableID. After that match it with a correct tbname and only then go get a correct indname. They sure do not make it easy on you.

I think I will pipe the output to a file. From there I would slice and dice that file into a two sections: table and index files. From there load that data into tables and then write SQL to get what I really need.

What do you think?
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #11 (permalink)  
Old 06-09-10, 11:14
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
I usually do the same trick, output to textfile and process it for presentation. I will appreciate when you will do that.

My surprise is that why IBM has not provided a view like may other useful views. Is there any place where we can suggest IBM for future versions.

I can do a lot easy scripting in windows native .BAT scripts and also VBScript system scripts.

Regards
Reply With Quote
  #12 (permalink)  
Old 06-09-10, 11:53
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Reply With Quote
  #13 (permalink)  
Old 06-09-10, 12:50
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
hmm, I guess I can go back to sleep ya'll good night

Thanks Andy
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #14 (permalink)  
Old 06-09-10, 19:51
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Quote:
Originally Posted by Cougar8000 View Post
good night
sleep tight
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