Retrieving Information About Workload Replays

You can retrieve all information about the workload captures in a replay directory object and the history of the workload replay attempts from the directory. By default, the workload replay divergence data is not loaded, but you can selectively choose to load this data.

To retrieve information about workload replays:

  • Call the DBMS_WORKLOAD_REPLAY.GET_REPLAY_INFO function.

    The GET_REPLAY_INFO function first imports a row into the DBA_WORKLOAD_CAPTURES view, which contains information about the workload capture. By default, it then only imports information for replays that have not been previously loaded into the DBA_WORKLOAD_REPLAYS view. This function returns the cap_id of the capture directory (for a consolidated capture directory, the cap_id returned is 0), which can be associated with the CAPTURE_ID column in the DBA_WORKLOAD_REPLAYS view to access the information retrieved.

    The GET_REPLAY_INFO function uses the following parameters:

    • The replay_dir required parameter, which specifies the name of the workload replay directory object.

    • The load_divergence optional parameter, which specifies if divergence data is loaded. The default value for this parameter is FALSE. To load divergence data, which imports rows for every replay attempt retrieved from the replay directory into the DBA_WORKLOAD_REPLAY_DIVERGENCE view, set this parameter to TRUE. Alternatively, you can use the LOAD_DIVERGENCE procedure to selectively load divergence data for a single replay or all replays in a directory object after the replay information is retrieved, as described in "Loading Divergence Data for Workload Replay".

Example 12-1 Retrieving information about workload replay

The following example shows how to retrieve information about the workload captures and the history of the workload replay attempts for the replay directory object named jul14, and to validate that the information is retrieved.

DECLARE
  cap_id         NUMBER;
BEGIN
  cap_id := DBMS_WORKLOAD_REPLAY.GET_REPLAY_INFO(replay_dir => 'jul14');
  SELECT capture_id
    FROM dba_workload_replays
   WHERE capture_id = cap_id;
END;
/