Generating Capture Subsets Using APIs

This section describes how to generate capture subsets from existing workload captures using the DBMS_WORKLOAD_REPLAY package. For information about capture subsets, see "Capture Subsets".

To generate a capture subset from existing workload captures:

  1. Use the GENERATE_CAPTURE_SUBSET procedure:

    DBMS_WORKLOAD_REPLAY.GENERATE_CAPTURE_SUBSET (
       input_capture_dir        IN VARCHAR2,
       output_capture_dir       IN VARCHAR2,
       new_capture_name         IN VARCHAR2,
       begin_time               IN NUMBER,
       begin_include_incomplete IN BOOLEAN   DEFAULT TRUE,
       end_time                 IN NUMBER,
       end_include_incomplete   IN BOOLEAN   DEFAULT FALSE,
       parallel_level           IN NUMBER    DEFAULT NULL);
    
  2. Set the input_capture_dir parameter to the name of the directory object that points to an existing workload capture.

  3. Set the output_capture_dir parameter to the name of the directory object that points to an empty directory where the new workload capture will be stored.

  4. Set the new_capture_name parameter to the name of the new workload capture that is to be generated.

  5. Set the other parameters, which are optional, as appropriate.

    For information about these parameters, see Oracle Database PL/SQL Packages and Types Reference.

This example shows how to create a capture subset named peak_wkld at directory object peak_capdir from an existing workload capture at directory object rec_dir. The capture subset includes workload from 2 hours after the start of the workload capture (or 7,200 seconds) to 3 hours after the start of the workload capture (or 10,800 seconds).

EXEC DBMS_WORKLOAD_REPLAY.GENERATE_CAPTURE_SUBSET ('rec_dir', 'peak_capdir',
     'peak_wkld', 7200, TRUE, 10800, FALSE, 1);

See Also:

Oracle Database PL/SQL Packages and Types Reference for information about the GENERATE_CAPTURE_SUBSET procedure