Neoview Workload Management Services Guide (R2.5)
rule-action
specifies an action to take if rule-specifier-list evaluates to true. If you specify a
NO-WARN warn-level, you must specify a rule-action. For a compilation rule, you
can specify one of these actions:
REJECT | HOLD | { SQL_CMD "sql-string;" }
REJECT
causes the query to be rejected.
HOLD
causes the query to be put in the holding state.
SQL_CMD "sql-string;"
causes the NDCS server to execute an SQL command (or a series of SQL commands)
before executing the query.
“sql-string;”
is an SQL command string, which is issued when the rule evaluates to true. You must
enclose the SQL string in double quotes. The combined length of the command string
must not exceed 1024 bytes. Separate each command with a semicolon (;). The last
command must always end with a semicolon. The string can contain multibyte
characters. For information on using multibyte character sets, see the Neoview Character
Sets Administrator's Guide.
rule-comment
is optional text that you can specify to describe the rule you are creating. comment-string
cannot exceed 256 characters. You must enclose the comment in double quotes.
Considerations
• If you specify NO-WARN, you must specify a rule-action.
• Use the ALTER SERVICE COMP command to associate compilation rules with a service.
• You cannot add a rule that begins with the reserved “HPS_” prefix or that has the same
name as one of the predefined rules, HPS_MANAGEABILITY1 through 11 and
HPS_TRANSPORTER1.
Examples
• This command adds a compilation rule that sets the warning level to high and rejects a query
if its estimated used rows exceed 50,000 rows:
ADD RULE COMP COMPRULE1 (EST_USED_ROWS > 50000, WARN-HIGH, REJECT);
• This command adds a compilation rule that sets the warning level to medium and puts a
query on hold if its estimated used rows exceed 25,000 rows:
ADD RULE COMP COMPRULE2 (EST_USED_ROWS > 25000, WARN-MEDIUM, HOLD);
• This command adds a compilation rule that sets the warning level to low if a query's
estimated used rows exceed 1000 rows:
ADD RULE COMP COMPRULE3 (EST_USED_ROWS > 1000, WARN-LOW);
• This command adds a compilation rule that sets the warning level to high and puts a query
on hold only if all three rule expressions—EST_TOTAL_TIME >= 10, EST_TOTAL_TIME
<= 20, and NUM_JOINS > 4—evaluate to true:
ADD RULE COMP COMPRULE4 (AND,
EST_TOTAL_TIME >= 10,
EST_TOTAL_TIME <= 20,
NUM_JOINS > 4,
WARN-HIGH,
HOLD) COMMENT "Created by DBA on 5/14/2010";
• This command adds a compilation rule that rejects a query if any of the six rule expressions
evaluates to true:
176 WMS Commands