IBM Support

How to subset DBMON or plan cache snapshot by query text

Troubleshooting


Problem

Sometimes working with very large DBMONs or plan cache snapshots can be cumbersome.   If you know the statement in question you can try subsetting them in order to be more user friendly.    Here are the steps to do this.   These are for a plan cache snapshot, but DBMON  should be similar.
First, verify the query can be found in the snapshot.  Using a basic query as an example. 

SELECT * FROM library/snapshot WHERE qq1000 like
'SELECT * FROM DATALIB/DATAFILE WHERE%'   <----this is case sensitive
If you get results and see your query, then you can subset the snapshot to have those matching queries in it

create table ts2888888g/subset1                                   
as (SELECT * FROM library/snapshot WHERE (qqjnum, qqucnt) in (
  (select qqjnum, qqucnt  FROM library/snapshot              
 WHERE qq1000 like                                                
  'SELECT * FROM DATALIB/DATAFILE WHERE%'))) with data     
Once that completes you have to add the 3018 records:

insert into library/subset1                       
(SELECT * FROM library/snapshot WHERE qqrid=3018)  
After you do this you need to import hte snapshot or DBMON and then review using ACS like usual. 

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Component":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
18 December 2019

UID

ibm11098249