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

93 lines
6.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="Examples of setting query time limits" />
<meta name="abstract" content="To set the query time limit for the current job or user session using query options file QAQQINI, specify QRYOPTLIB parameter on the Change Query Attributes (CHGQRYA) command to a user library where the QAQQINI file exists with the parameter set to QUERY_TIME_LIMIT, and the value set to a valid query time limit." />
<meta name="description" content="To set the query time limit for the current job or user session using query options file QAQQINI, specify QRYOPTLIB parameter on the Change Query Attributes (CHGQRYA) command to a user library where the QAQQINI file exists with the parameter set to QUERY_TIME_LIMIT, and the value set to a valid query time limit." />
<meta name="DC.subject" content="examples, governor, setting query time limit, using JOB parameter" />
<meta name="keywords" content="examples, governor, setting query time limit, using JOB parameter" />
<meta name="DC.Relation" scheme="URI" content="govrle.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/chgqrya.htm" />
<meta name="DC.Relation" scheme="URI" content="../cl/chgsysval.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="qrygovexamp" />
<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>Examples of setting query time limits</title>
</head>
<body id="qrygovexamp"><a name="qrygovexamp"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Examples of setting query time limits</h1>
<div><p>To set the query time limit for the current job or user session
using query options file QAQQINI, specify QRYOPTLIB parameter on the <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command to a user library where the QAQQINI
file exists with the parameter set to QUERY_TIME_LIMIT, and the value set
to a valid query time limit. </p>
<div class="section"><p>To set the query time limit for 45 seconds you can use the following <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command: </p>
<pre> CHGQRYA JOB(*) QRYTIMLMT(45)</pre>
<p>This
sets the query time limit at 45 seconds. If the user runs a query with an
estimated runtime equal to or less than 45 seconds, the query runs without
interruption. The time limit remains in effect for the duration of the job
or user session, or until the time limit is changed by the <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command.</p>
<p>Assume that the query
optimizer estimated the runtime for a query as 135 seconds. A message is sent
to the user that stated that the estimated runtime of 135 seconds exceeds
the query time limit of 45 seconds.</p>
<p>To set or change the query time
limit for a job other than your current job, the <span class="cmdname">Change Query Attributes
(CHGQRYA)</span> command is run using the JOB parameter. To set the query
time limit to 45 seconds for job 123456/USERNAME/JOBNAME use the following <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command: </p>
<pre> CHGQRYA JOB(123456/USERNAME/JOBNAME) QRYTIMLMT(45)</pre>
<p>This
sets the query time limit at 45 seconds for job 123456/USERNAME/JOBNAME.
If job 123456/USERNAME/JOBNAME tries to run a query with an estimated runtime
equal to or less than 45 seconds the query runs without interruption. If the
estimated runtime for the query is greater than 45 seconds, for example 50
seconds, a message is sent to the user stating that the estimated runtime
of 50 seconds exceeds the query time limit of 45 seconds. The time limit remains
in effect for the duration of job 123456/USERNAME/JOBNAME, or until the time
limit for job 123456/USERNAME/JOBNAME is changed by the <span class="cmdname">Change Query
Attributes (CHGQRYA)</span> command.</p>
<p>To set or change
the query time limit to the QQRYTIMLMT system value, use the following <span class="cmdname">Change
Query Attributes (CHGQRYA)</span> command: </p>
<pre> CHGQRYA QRYTIMLMT(*SYSVAL)</pre>
<p>The
QQRYTIMLMT system value is used for duration of the job or user session, or
until the time limit is changed by the <span class="cmdname">Change Query Attributes (CHGQRYA)</span> command.
This is the default behavior for the <span class="cmdname">Change Query Attributes (CHGQRYA)</span> command.</p>
<div class="p"> <div class="note"><span class="notetitle">Note:</span> The
query time limit can also be set in the INI file, or by using the <span class="cmdname">Change
System Value (CHGSYSVAL)</span> command.</div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="govrle.htm" title="The DB2 Universal Database for iSeries Predictive Query Governor can stop the initiation of a query if the estimated run time (elapsed execution time) or estimated temporary storage for the query is excessive. The governor acts before a query is run instead of while a query is run. The governor can be used in any interactive or batch job on the iSeries. It can be used with all DB2 Universal Database for iSeries query interfaces and is not limited to use with SQL queries.">Set resource limits with the Predictive Query Governor</a></div>
</div>
<div class="relinfo"><strong>Related information</strong><br />
<div><a href="../cl/chgqrya.htm">Change Query Attributes (CHGQRYA) command</a></div>
<div><a href="../cl/chgsysval.htm">Change System Value (CHGSYSVAL) command</a></div>
</div>
</div>
</body>
</html>