Home > AS/400 Tips > iSeries administrator tips > Using STRDBG to analyze OPNQRYF
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Using STRDBG to analyze OPNQRYF


Guy Roberto Pacheco
11.26.2001
Rating: -3.84- (out of 5) Hall of fame tip of the month winner


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


When you use the STRDBG command, the operation system generates additional information on joblog that can be valuable in analyzing the performance of OPNQRYF commands.



Code

1. Program example:

0001.00 OPNQRYF FILE((MAXPD/FI100U) (MAXPD/FI104U) + 0002.00 (MAXPD/FI114U)) FORMAT(MAXPD/FI100U) + 0003.00 QRYSLT('u100nomlat=u104nomlat & + 0004.00 u104nomlat=u114nomlat') KEYFLD((U100DESPRC)) 0005.00 CPYFRMQRYF FROMOPNID(FI100U) TOFILE(SHNTMP/RESULT) + 0006.00 MBROPT(*REPLACE) CRTFILE(*YES)

2. DSPJOBLOG whithout debug
3 > call shntmp/qry1
Member FI100U file FI100U in MAXPD opened.
Physical file RESULT created in library SHNTMP.
Member RESULT added to file RESULT in SHNTMP.
40185 records copied from member FI100U.

3. DSPJOBLOG with STRDBG
3 > strdbg
3 > call shntmp/qry1
Unable to retrieve query options file.
All access paths were considered for file FI100U.
All access paths were considered for file FI114U.
Access path built for file FI100U.
File FI100U processed in join position 1.
File FI104U processed in join position 2.
File FI114U processed in join position 3.
Member FI100U file FI100U in MAXPD opened.
40185 records copied from member FI100U.

4. Use F1 over the messages to analyze command.

Example 1:

Message . . . . : All access paths were considered for file FI100U. Cause . . . . . : The OS/400 Query optimizer considered all access paths built over member FI100U of file FI100U in library MAXPD. The list below shows the access paths considered. If file FI100U in library MAXPD is a logical file then the access paths specified are actually built over member FI100U of physical file FI100U in library MAXPD. Following each access path name in the list is a reason code which explains why the access path was not used. A reason code of 0 indicates that the access path was used to implement the query.

MAXPD/LI100U1 5, MAXPD/LI100U2 5, MAXPD/LI100U3

5. The reason codes and their meanings follow:

1 - Access path was not in a valid state. The system invalidated the access path.
2 - Access path was not in a valid state. The user requested that the access path be rebuilt.
3 - Access path is a temporary access path (resides in library QTEMP) and was not specified as the file to be queried.
4 - The cost to use this access path, as determined by the optimizer, was higher than the cost associated with the chosen access method.
5 - The keys of the access path did not match the fields specified for the ordering/grouping criteria. For distributed file queries, the access path keys must exactly match the ordering fields if the access path is to be used when ALWCPYDTA(*YES or *NO) is specified.
6 - The keys of the access path did not match the fields specified for the join criteria.

--> In this example the system can't use one of existing logical files (access path). Maybe you can create another logical file or change the sequence in command.

Example 2:

 
Message ID . . . . . . :   CPI4321       Severity . . . . . . . :   00        
Message type . . . . . :   Information                                        
Date sent  . . . . . . :   23/11/01      Time sent  . . . . . . :   14:22:00  
                                                                              
Message . . . . :   Access path built for file FI100U.                        
Cause . . . . . :   A temporary access path was built to access records from member FI100U of file FI100U in library MAXPD for reason code 1. This process took 0 minutes and ,2 seconds. The access path built contains 1188 entries. The access path was built using 0 parallel tasks. A zero for the number of parallel tasks indicates that parallelism was not used. The reason   codes and their meanings follow: 

1 - Perform specified ordering/grouping criteria.
2 - Perform specified join criteria.
3 - Perform specified record selection to minimize I/O wait time.

The access path was built using the following key fields. The key fields and their corresponding sequence (ASCEND or DESCEND) will be shown:

--> The system had to build a temporary access path. This message has the time it took and the reason.

6. Try it with your queries to improve system performance.
Good Luck!


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
iSeries administrator tips
Analyze the health of your IBM i server with iScore
Researching high availability for your System i shop
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i
Translating Linux for IBM i admins: User profile commands
Modern System i reports using Client Access
Tips for installing Lotus Domino server on a System i partition

Systems Management
Can you trust all those trigger programs?
Are your backups complete?
Controlling remote command processing
Watch your profiles
Avoid locking issues
Send message to users at a remote site
Security journal receiver management
Top 10 backup commands
Create an iSeries Access image and update it with the latest Service Pack
Tracking critical file access in real time

Performance
Will overloaded discs impact iSeries performance?
Extend storage capacity on an IBM i without negatively effecting system performance
Database drivers on the i: MySQL vs. IBM Toolbox
Performance tuning for IBM i: The basics and beyond
IBM releases new Power products for the midrange
Top System i admin tips for 2006
Catholic Charities keeps track of homeless with iSeries
i5 error messages: What you need to know
IBM races for clock speed
System shutting down after cleanup

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts