An ALTER WORKLOAD statement changes a workload in the catalogs.
Before you begin
To alter a workload, you require SQLADM, WLMADM,
or DBADM authority. To specify any clause other than a COLLECT clause,
the authorization id must include WLMADM or DBADM authority.
See Workload management DDL statements for more information about prerequisites.
Procedure
To alter a workload:
- Specify one or more of the following properties for the
workload using the ALTER WORKLOAD statement:
- The connection attributes. You can add connection attributes to
and drop connection attributes from the workload definition unless
it is the SYSDEFAULTUSERWORKLOAD or SYSDEFAULTADMWORKLOAD workload.
The incoming connection must supply matching connection attributes
to those that you specified for the workload for a match to occur.
For more information, see Work identification by origin with workloads. To see
the connection attributes for a workload, query the SYSCAT.WORKLOADCONNATTR
view.
- A value that indicates whether an occurrence of this workload
is permitted to access the database. By default, an occurrence of
this workload is permitted to access the database. You cannot remove
database access from the SYSDEFAULTADMWORKLOAD workload.
- A value that indicates whether the workload is enabled or disabled.
By default, the workload is enabled. You cannot disable the SYSDEFAULTUSERWORKLOAD
or the SYSDEFAULTADMWORKLOAD workload.
- The service class under which occurrences of this workload are
to be executed. The SYSDEFAULTUSERCLASS service superclass is the
default. If you specify a user-defined service superclass, you can
specify a service subclass under the service superclass. You cannot
specify the SYSDEFAULTSUBCLASS subclass under any service superclass,
including the SYSDEFAULTUSERCLASS service superclass. In addition,
you cannot specify the SYSDEFAULTSYSTEMCLASS or SYSDEFAULTMAINTENANCECLASS
service superclass.
- The position of the workload relative to other workloads, which
determines the order in which the workload is evaluated during workload
assignment. You cannot specify the position of the SYSDEFAULTUSERWORKLOAD
or the SYSDEFAULTADMWORKLOAD workload. For more information, see Workload assignment.
- The type of activity information to collect. By default, no information
for activities associated with the workload is sent to an activities
event monitor.
- The monitoring activity metrics collection level
for activities submitted by connections associated with this workload. Note that
the effective activity collection setting for activities is the combination
of both the workload activity metrics collection level and the mon_act_metrics database
configuration parameter.
- The aggregate activity information to collect.
The aggregate activity information used for the workload only changes
after the ALTER WORKLOAD operation is committed.
- The lock timeout event information to send to
the locking event monitor, if one is active, when a lock event occurs.
- The deadlock information to send to the locking
event monitor, if one is active, when a deadlock event occurs.
- The lock wait information to collect.
- The unit of work information for each transaction
associated with this workload to send to the unit of work event monitor, if
one is active, when a unit of work ends.
- The histogram templates that the workload should
use as templates for its histograms. The histogram templates specified
are reflected in the SYSCAT.HISTOGRAMTEMPLATEUSE view. For more information
about histograms and histogram templates, see Histograms in workload management.
- Commit your changes.
When you commit your
changes the workload is updated in the SYSCAT.WORKLOADS view. The
committed change causes a workload re-evaluation to take place at
the beginning of the next unit of work of each application. Depending
on which workload is chosen, the application might be reassigned to
a different workload.
What to do next
You might need to grant the USAGE privilege
on it to one or more session users. (Session users with DBADM authority
have an implicit privilege to use any workload.) Even if a connection
provides an exact match to the connection attributes of the workload,
if the session user does not have the USAGE privilege on the workload,
the data server does not associate the connection with the workload
to create an occurrence of the workload. For more information, see Granting the USAGE privilege on a workload .