This section describes how to add workload captures to and remove workload captures from replay schedules using the DBMS_WORKLOAD_REPLAY
package. For information about adding workload captures to replay schedules, see "Adding Workload Captures".
Before adding workload captures to a replay schedule, ensure that the following prerequisite is met:
A replay schedule to which the workload captures are to be added is created.
For information about creating a replay schedule, see "Creating Replay Schedules Using APIs".
To add workload captures to a replay schedule:
DBMS_WORKLOAD_REPLAY.ADD_CAPTURE ( capture_dir_name IN VARCHAR2, start_delay_seconds IN NUMBER DEFAULT 0, stop_replay IN BOOLEAN DEFAULT FALSE, take_begin_snapshot IN BOOLEAN DEFAULT FALSE, take_end_snapshot IN BOOLEAN DEFAULT FALSE, query_only IN BOOLEAN DEFAULT FALSE) RETURN NUMBER;
DBMS_WORKLOAD_REPLAY.ADD_CAPTURE ( capture_dir_name IN VARCHAR2, start_delay_seconds IN NUMBER, stop_replay IN VARCHAR2, take_begin_snapshot IN VARCHAR2 DEFAULT 'N', take_end_snapshot IN VARCHAR2 DEFAULT 'N', query_only IN VARCHAR2 DEFAULT 'N') RETURN NUMBER;
This function returns an unique identifier that identifies the workload capture in this replay schedule.
"About Query-Only Database Replay" for information about query-only database replays.
Set the capture_dir_name
parameter to the name of the directory object that points to the workload capture under the top-level replay directory.
The directory must contain a valid workload capture that is preprocessed on a system running the same database version as the replay system.
Set the other parameters, which are optional, as appropriate.
For information about these parameters, see Oracle Database PL/SQL Packages and Types Reference.
The following example shows how to add a workload capture named peak_wkld
to a replay schedule by using the ADD_CAPTURE
function in a SELECT
statement.
SELECT DBMS_WORKLOAD_REPLAY.ADD_CAPTURE ('peak_wkld') FROM dual;
You can also use the DBMS_WORKLOAD_REPLAY
package to remove workload captures from a replay schedule.
To remove workload captures from a replay schedule:
Use the REMOVE_CAPTURE
procedure:
DBMS_WORKLOAD_REPLAY.REMOVE_CAPTURE ( schedule_capture_number IN NUMBER);
Set the schedule_capture_number
parameter to the unique identifier that identifies the workload capture in this replay schedule.
The unique identifier is the same identifier that was returned by the ADD_CAPTURE
function when the workload capture was added to the replay schedule.
Oracle Database PL/SQL Packages and Types Reference for information about the ADD_CAPTURE
function
Oracle Database PL/SQL Packages and Types Reference for information about the REMOVE_CAPTURE
procedure