Dropping a workload

Dropping a workload removes it from the database catalog.

Before you begin

To drop a workload, you require WLMADM or DBADM authority.

See Workload management DDL statements for more information about prerequisites.

Procedure

To drop a workload:

  1. Disable the workload by specifying the ALTER WORKLOAD statement.
    See Disabling a workload for more information. Disabling the workload prevents new occurrences of the workload from being able to run against the database.
  2. Ensure that no occurrences of this workload are running by using the WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES table function.
    For more information, see WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES table function.

    The WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES table function returns the application handles corresponding to the active workload occurrences. You can use the FORCE APPLICATION command to terminate the applications using the application handles.

  3. Drop the workload by specifying the DROP WORKLOAD statement.
    For example, to drop the ACCTNG workload, specify the following statement:
    DROP WORKLOAD ACCTNG
  4. Commit your changes.
    When you commit your changes, the workload is removed from the SYSCAT.WORKLOADS view. In addition, authorization information for the workload is removed from the SYSCAT.WORKLOADAUTH view.