Defining Workload Capture Filters

This section describes how to add and remove workload capture filters. For information about using workload filters with workload capture, see "Using Filters with Workload Capture".

To add filters to a workload capture:

  • Use the ADD_FILTER procedure:

    BEGIN
      DBMS_WORKLOAD_CAPTURE.ADD_FILTER (
                               fname => 'user_ichan',
                               fattribute => 'USER',
                               fvalue => 'ICHAN');
    END;
    /
    

    In this example, the ADD_FILTER procedure adds a filter named user_ichan, which can be used to filter out all sessions belonging to the user name ICHAN.

    The ADD_FILTER procedure in this example uses the following parameters:

    • The fname required parameter specifies the name of the filter that will be added.

    • The fattribute required parameter specifies the attribute on which the filter will be applied. Valid values include PROGRAM, MODULE, ACTION, SERVICE, INSTANCE_NUMBER, and USER.

    • The fvalue required parameter specifies the value for the corresponding attribute on which the filter will be applied. It is possible to use wildcards such as % with some of the attributes, such as modules and actions.

To remove filters from a workload capture:

  • Use the DELETE_FILTER procedure:

    BEGIN
      DBMS_WORKLOAD_CAPTURE.DELETE_FILTER (fname => 'user_ichan');
    END;
    /
    

    In this example, the DELETE_FILTER procedure removes the filter named user_ichan from the workload capture.

    The DELETE_FILTER procedure in this example uses the fname required parameter, which specifies the name of the filter to be removed. The DELETE_FILTER procedure will not remove filters that belong to completed captures; it only applies to filters of captures that have yet to start.