ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzajq_5.4.0.1/dbmonexamples.htm

91 lines
7.0 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="Database monitor examples" />
<meta name="abstract" content="The iSeries navigator interface provides a powerful tool for gathering and analyzing performance monitor data using database monitor. However, you may want to do your own analysis of the database monitor files." />
<meta name="description" content="The iSeries navigator interface provides a powerful tool for gathering and analyzing performance monitor data using database monitor. However, you may want to do your own analysis of the database monitor files." />
<meta name="DC.subject" content="database monitor, examples" />
<meta name="keywords" content="database monitor, examples" />
<meta name="DC.Relation" scheme="URI" content="dms.htm" />
<meta name="DC.Relation" scheme="URI" content="rzajqmon1.htm" />
<meta name="DC.Relation" scheme="URI" content="rzajqmon2.htm" />
<meta name="DC.Relation" scheme="URI" content="rzajqmon3.htm" />
<meta name="DC.Relation" scheme="URI" content="rzajqmon4.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/strdbmon.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/enddbmon.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="dbmonexamples" />
<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>Database monitor examples</title>
</head>
<body id="dbmonexamples"><a name="dbmonexamples"><!-- --></a>
<img src="./delta.gif" alt="Start of change" /><!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Database monitor examples</h1>
<div><p>The iSeries™ navigator
interface provides a powerful tool for gathering and analyzing performance
monitor data using database monitor. However, you may want to do your own
analysis of the database monitor files.</p>
<div class="section"><p>Suppose you have an application program with SQL statements and
you want to analyze and performance tune these queries. The first step in
analyzing the performance is collection of data. The following examples show
how you might collect and analyze data using <span class="cmdname">Start Database Monitor
(STRDBMON)</span> and <span class="cmdname">End Database Monitor (ENDDBMON)</span> commands.
Performance data is collected in LIB/PERFDATA for an application running in
your current job. The following sequence collects performance data and prepares
to analyze it.</p>
</div>
<div class="section"> <ol><li><span class="cmdname">STRDBMON</span> FILE(LIB/PERFDATA) TYPE(*DETAIL). If this
table does not already exist, the command will create one from the skeleton
table in QSYS/QAQQDBMN.</li>
<li>Run your application</li>
<li><span class="cmdname">ENDDBMON</span></li>
<li>Create views over LIB/PERFDATA using the SQL DDL. Creating the views is
not mandatory. All of the information resides in the base table that was specified
on the <span class="cmdname">STRDBMON</span> command. The views simply provide an easier
way to view the data.</li>
</ol>
</div>
<div class="section"><p>You are now ready to analyze the data. The following examples
give you a few ideas on how to use this data. You should closely study the
physical and logical view formats to understand all the data being collected
so you can create queries that give the best information for
your applications.</p>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzajqmon1.htm">Database monitor performance analysis example 1</a></strong><br />
Determine which queries in your SQL application are implemented with table scans. The complete information can be obtained by joining two views: QQQ1000, which contains information about the SQL statements, and QQQ3000, which contains data about queries performing table scans.</li>
<li class="ulchildlink"><strong><a href="rzajqmon2.htm">Database monitor performance analysis example 2</a></strong><br />
Similar to the preceding example that showed which SQL applications were implemented with table scans, the following example shows all queries that are implemented with table scans.</li>
<li class="ulchildlink"><strong><a href="rzajqmon3.htm">Database monitor performance analysis example 3</a></strong><br />
Your next step may include further analysis of the table scan data. The previous examples contained a column titled Index Advised. A 'Y' (yes) in this column is a hint from the query optimizer that the query may perform better with an index to access the data. For the queries where an index is advised, notice that the rows selected by the query are low in comparison to the total number of rows in the table. This is another indication that a table scan may not be optimal. Finally, a long execution time may highlight queries that may be improved by performance tuning.</li>
<li class="ulchildlink"><strong><a href="rzajqmon4.htm">Additional database monitor examples</a></strong><br />
The following are additional ideas or examples on how to extract information from the performance monitor statistics. All of the examples assume data has been collected in LIB/PERFDATA and the documented views have been created.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dms.htm" title="Start Database Monitor (STRDBMON) command gathers information about a query in real time and stores this information in an output table. This information can help you determine whether your system and your queries are performing as they should, or whether they need fine tuning. Database monitors can generate significant CPU and disk storage overhead when in use.">Monitoring your queries using Start Database Monitor (STRDBMON)</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/strdbmon.htm">Start Database Monitor (STRDBMON) command</a></div>
<div><a href="../cl/enddbmon.htm">End Database Monitor (ENDDBMON) command</a></div>
</div>
</div>
<img src="./deltaend.gif" alt="End of change" /></body>
</html>