Neoview Workload Management Services Guide (R2.4)

Adding an Execution Rule
Use the ADD RULE EXEC command to define an execution rule in WMS. For example, this ADD
RULE EXEC command defines the execution rule, EXECRULE4, setting the rule action to CANCEL
if the number of rows accessed is greater than 500 and the elapsed time is greater than 15 minutes:
NS%ADD RULE EXEC EXECRULE4 (AND, ACCESSED_ROWS > 500,
ELAPSED_TIME > 15, NO-WARN, CANCEL);
--- WMS operation complete.
NS%
Here are some things to consider when defining execution rules:
“Specifying the Execution Rule Expressions” (page 61)
“Specifying the AND or OR Operator” (page 61)
“Specifying a Warning Level for the Execution Rule” (page 62)
“Specifying an Action for the Execution Rule” (page 63)
Adding a Comment for the Execution Rule” (page 63)
For the syntax, see the ADD RULE EXEC Command” (page 88).
Specifying the Execution Rule Expressions
You can specify one to fifteen expressions in an execution rule to define the conditions that must
be met for the execution rule to trigger a warning level or an action. In each expression, you can
set a condition for one of these query runtime statistics:
Table 4-3 Query Runtime Statistics for Execution Rule Expressions
Name in an Execution Rule ExpressionName in STATUS QUERIES or STATUS
QUERY Output
Query Runtime Statistic
USED_ROWSUSED_ROWSNumber of rows returned to the
query
ACCESSED_ROWSACCESSED_ROWSNumber of rows accessed by the
query
TOTAL_MEM_ALLOC (in kilobytes)TOTAL_MEM_ALLOC (in kilobytes)Total memory used to process the
query
ELAPSED_TIME (in minutes)ELAPSED_TIME (in microseconds)Elapsed time of the query execution
Each expression must be separated by a comma in the ADD RULE EXEC command. For example,
this ADD RULE EXEC command defines an execution rule that has four execution rule
expressions, highlighted in boldface:
ADD RULE EXEC EXECRULE5 (AND,
ELAPSED_TIME > 5,
ELAPSED_TIME <= 15,
TOTAL_MEM_ALLOC > 32,
TOTAL_MEM_ALLOC < 64,
WARN-HIGH) COMMENT "Created by DBA on 5/14/2009";
In this example, all four execution rule expressions must evaluate to true for the execution rule,
EXECRULE5, to be considered true.
For the syntax of the execution rule expressions, see the ADD RULE EXEC Command” (page 88).
For more information about the AND operator, see “Specifying the AND or OR Operator
(page 61).
Specifying the AND or OR Operator
If the rule has only one expression, the expression must be true for the rule to trigger a warning
level or an action. For example, this ADD RULE EXEC command defines an execution rule that
Execution Rules 61