Generating Workload Capture Reports Using APIs

You can generate a workload capture report using the DBMS_WORKLOAD_CAPTURE package. You can also use Oracle Enterprise Manager to generate a workload capture report, as described in "Accessing Workload Capture Reports Using Enterprise Manager".

To generate a report on the latest workload capture:

  1. Use the DBMS_WORKLOAD_CAPTURE.GET_CAPTURE_INFO procedure.

    The GET_CAPTURE_INFO procedure retrieves all information regarding the workload capture and returns the cap_id for the workload capture. This function uses the dir required parameter, which specifies the name of the workload capture directory object.

  2. Call the DBMS_WORKLOAD_CAPTURE.REPORT function.

    The REPORT function generates a report using the cap_id that was returned by the GET_CAPTURE_INFO procedure. This function uses the following parameters:

    • The capture_id required parameter relates to the directory that contains the workload capture for which the report will be generated. The directory should be a valid directory in the host system containing the workload capture. The value of this parameter should match the cap_id returned by the GET_CAPTURE_INFO procedure.

    • The format required parameter specifies the report format. Valid values include DBMS_WORKLOAD_CAPTURE.TYPE_TEXT and DBMS_WORKLOAD_REPLAY.TYPE_HTML.

In this example, the GET_CAPTURE_INFO procedure retrieves all information regarding the workload capture in the jul14 directory and returns the cap_id for the workload capture. The REPORT function then generates a text report using the cap_id that was returned by the GET_CAPTURE_INFO procedure.

DECLARE
  cap_id         NUMBER;
  cap_rpt        CLOB;
BEGIN
  cap_id  := DBMS_WORKLOAD_CAPTURE.GET_CAPTURE_INFO(dir => 'jul14');
  cap_rpt := DBMS_WORKLOAD_CAPTURE.REPORT(capture_id => cap_id,
                           format => DBMS_WORKLOAD_CAPTURE.TYPE_TEXT);
END;
/

For information about how to interpret the workload capture report, see "Reviewing Workload Capture Reports".

See Also: