Setting limits for system resource usage by using the resource limit facility

The DB2® resource limit facility (governor) enables you to limit resource usage, bind operations, and parallelism modes in the processing of certain SQL statements. Resource limits apply only to dynamic SQL statements.

About this task

Introductory concepts

You can use the resource limit facility for following activities:

  • Set warning and error thresholds for SQL statements. The resource limit facility can inform users (through your application programs) that a processing limit might be exceeded for a particular SQL statement. These limits are sometimes called predictive governing. The resource limit facility provides an estimate of the processing cost of SQL statements before they run. To predict the cost of an SQL statement, you execute EXPLAIN to put information about the statement cost in DSN_STATEMNT_TABLE. If the statement exceeds a predictive governing limit, it receives a warning or error SQL code.
  • These limits are sometimes called reactive governing.
  • Restrict bind and rebind activities to avoid performance impacts on production data.

You can use reactive or predictive governing separately, or in combination.

Start of changeResource limits apply only to dynamic SQL statements. Resource limits apply to SQL statement regardless of whether they are issued locally or remotely. Start of changeThe resource limit facility does not control static SQL statements regardless of whether they are issued locally or remotely, and no limits apply to primary or secondary authorization IDs that have installation SYSADM or installation SYSOPR authority.End of changeEnd of change

Resource limits apply only to the following types of SQL statements:

  • SELECT
  • INSERT
  • UPDATE
  • MERGE
  • TRUNCATE
  • DELETE
Start of change

Procedure

To set limits for system resource usage:

  1. Create a DSNRLSTxx table, a DSNRLMTxx table, or one of each.
  2. Populate the content of the table or tables.
  3. Use the START RLIMIT command to activate the resource limit facility.
End of change