Preventing occurrences of a workload from accessing the database

Use this task to control which workloads can access the database. Before a workload occurrence begins to run, the data server checks whether the workload is permitted to access the database. If you prevent the workload occurrence from accessing the database, an error is returned indicating that the workload occurrence is rejected.

Before you begin

To prevent a workload from accessing the database, you require WLMADM or DBADM authority.

See Workload management DDL statements for more information about prerequisites.

About this task

Preventing a workload occurrence from accessing the database is not the same as disabling a workload. When you disable a workload, the workload definition is not cached in memory and is therefore not considered for workload assignment.

Procedure

To prevent a workload from accessing a database:

  1. Use the DISALLOW DB ACCESS option of the ALTER WORKLOAD statement, as shown in the following example:
    ALTER WORKLOAD workload-name DISALLOW DB ACCESS ...
  2. Commit your changes.
    When you commit your changes, the workload is updated in the SYSCAT.WORKLOADS view.

Results

Altering a workload to prevent its occurrences from accessing a database takes effect at the beginning of the next unit of work for workload occurrences that are already running. For example, if you specify ALLOW DB ACCESS for workload A and alter the workload by specifying DISALLOW DB ACCESS, occurrences of workload A that are already running receive an SQL error at the beginning of the next unit of work. New occurrences of workload A are rejected.