88 lines
5.6 KiB
HTML
88 lines
5.6 KiB
HTML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE html
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html lang="en-us" xml:lang="en-us">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="security" content="public" />
|
|
<meta name="Robots" content="index,follow" />
|
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
|
<meta name="DC.Type" content="reference" />
|
|
<meta name="DC.Title" content="Examine query optimizer debug messages in the job log" />
|
|
<meta name="abstract" content="Query optimizer debug messages issue informational messages to the job log about the implementation of a query. These messages explain what happened during the query optimization process." />
|
|
<meta name="description" content="Query optimizer debug messages issue informational messages to the job log about the implementation of a query. These messages explain what happened during the query optimization process." />
|
|
<meta name="DC.subject" content="message, debug mode, cause and user response, debug mode, viewing with iSeries Navigator" />
|
|
<meta name="keywords" content="message, debug mode, cause and user response, debug mode, viewing with iSeries Navigator" />
|
|
<meta name="DC.Relation" scheme="URI" content="queryopt.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="qodm" />
|
|
<meta name="DC.Language" content="en-us" />
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
|
<title>Examine query optimizer debug messages in the job log</title>
|
|
</head>
|
|
<body id="qodm"><a name="qodm"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Examine query optimizer debug messages in the job log</h1>
|
|
<div><p>Query optimizer debug messages issue informational messages to
|
|
the job log about the implementation of a query. These messages explain what
|
|
happened during the query optimization process. </p>
|
|
<div class="section"><p>For example, you can learn: </p>
|
|
<ul><li>Why an index was or was not used</li>
|
|
<li>Why a temporary result was required</li>
|
|
<li>Whether joins and blocking are used</li>
|
|
<li>What type of index was advised by the optimizer</li>
|
|
<li>Status of the job's queries</li>
|
|
<li>Indexes used</li>
|
|
<li>Status of the cursor</li>
|
|
</ul>
|
|
</div>
|
|
<div class="section"><p>The optimizer automatically logs messages for all queries it optimizes,
|
|
including SQL, call level interface, ODBC, OPNQRYF, and SQL Query Manager.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Viewing debug messages using STRDBG command:</h4><p><span class="cmdname">STRDBG</span> command
|
|
puts a job into debug mode. It also specifies certain attributes of the debugging
|
|
session. For example, it can specify whether database files in production
|
|
schemas can be updated while in debug mode. For example, use the following
|
|
command: </p>
|
|
<pre>STRDBG PGM(Schema/program) UPDPROD(*YES)</pre>
|
|
<p><span class="cmdname">STRDBG</span> places
|
|
in the job log information about all SQL statements that run.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Viewing debug messages using QAQQINI table:</h4><p>You
|
|
can also set the QRYOPTLIB parameter on the <span class="cmdname">Change Query Attributes
|
|
(CHGQRYA)</span> command to a user schema where the QAQQINI table exists.
|
|
Set the parameter on the QAQQINI table to MESSAGES_DEBUG, and set the value
|
|
to *YES. This option places query optimization information in the job log.
|
|
Changes made to the QAQQINI table are effective immediately and will affect
|
|
all users and queries that use this table. Once you change the MESSAGES_DEBUG
|
|
parameter, all queries that use this QAQQINI table will write debug messages
|
|
to their respective joblogs. Pressing F10 from the command Entry panel displays
|
|
the message text. To see the second-level text, press F1 (Help). The second-level
|
|
text sometimes offers hints for improving query performance.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Viewing debug messages in Run SQL Scripts:</h4><p>To view
|
|
debug messages in Run SQL Scripts, from the <span class="uicontrol">Options</span> menu,
|
|
select <span class="uicontrol">Include Debug Messages in Job Log</span>. Then from
|
|
the <span class="uicontrol">View</span> menu, select <span class="uicontrol">Job Log</span>.
|
|
To view detailed messages, double-click a message.</p>
|
|
</div>
|
|
<div class="section"><h4 class="sectiontitle">Viewing debug messages in Visual Explain:</h4><p>In Visual
|
|
Explain, debug messages are always available. You do not need to turn them
|
|
on or off. Debug messages appear in the lower portion of the window. You can
|
|
view detailed messages by double-clicking on a message.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="queryopt.htm" title="Query optimization is an iterative process. You can gather performance information about your queries and control the processing of your queries.">Optimizing query performance using query optimization tools</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |