After the replay data is initialized, and connections and users are remapped, you need to prepare the database for workload replay. For information about workload replay preparation, see "Steps for Replaying a Database Workload".
To prepare workload replay on the replay system:
Use the PREPARE_REPLAY
procedure:
BEGIN DBMS_WORKLOAD_REPLAY.PREPARE_REPLAY (synchronization => OBJECT_ID, capture_sts => TRUE, sts_cap_interval => 300); END; /
In this example, the PREPARE_REPLAY
procedure prepares a replay that has been previously initialized. A SQL tuning set will also be captured in parallel with the workload replay.
The PREPARE_REPLAY
procedure uses the following parameters:
The synchronization
required parameter determines if synchronization will be used during workload replay.
If this parameter is set to OBJECT_ID
(the default value), all replay actions will be executed only after all relevant COMMIT
actions have completed. Relevant COMMIT
actions must meet the following criteria:
Issued before the given action in the workload capture
Modified at least one of the database objects for which the given action is referencing, either implicitly or explicitly
Setting this parameter to OBJECT_ID
allows for more concurrency during workload replays for COMMIT
actions that do not reference the same database objects during workload capture.
If this parameter is set to SCN
, the COMMIT
order in the captured workload will be preserved during replay and all replay actions will be executed only after all dependent COMMIT
actions have completed.
You can disable this option by setting the parameter to OFF
, but the replay will likely yield significant replay divergence. However, this may be desirable if the workload consists primarily of independent transactions, and divergence during unsynchronized replay is acceptable.
The connect_time_scale
parameter scales the elapsed time from when the workload capture started to when the session connects with the specified value and is interpreted as a % value. Use this parameter to increase or decrease the number of concurrent users during replay. The default value is 100.
The think_time_scale
parameter scales the elapsed time between two successive user calls from the same session and is interpreted as a % value. Setting this parameter to 0 will send user calls to the database as fast as possible during replay. The default value is 100.
The think_time_auto_correct
parameter corrects the think time (based on the think_time_scale
parameter) between calls when user calls take longer to complete during replay than during capture. This parameter can be set to either TRUE
or FALSE
. Setting this parameter to TRUE
reduces the think time if the workload replay is taking longer than the workload capture. The default value is TRUE
.
The scale_up_multiplier
parameter defines the number of times the workload is scaled up during replay. Each captured session will be replayed concurrently for as many times as specified by this parameter. However, only one session in each set of identical replay sessions will execute both queries and updates. The rest of the sessions will only execute queries.
The capture_sts
parameter specifies whether to capture a SQL tuning set in parallel with the workload replay. If this parameter is set to TRUE
, you can capture a SQL tuning set during workload replay and use SQL Performance Analyzer to compare it to another SQL tuning set without having to re-execute the SQL statements. This enables you to obtain a SQL Performance Analyzer report and compare the SQL performance—before and after the change—while running Database Replay. You can also export the resulting SQL tuning set with its AWR data using the EXPORT_AWR
procedure, as described in "Exporting AWR Data for Workload Replay".
This feature is not supported for Oracle RAC. Workload replay filters that are defined using DBMS_WORKLOAD_REPLAY
do not apply to the SQL tuning set capture. The default value for this parameter is FALSE
.
The sts_cap_interval
parameter specifies the duration of the SQL tuning set capture from the cursor cache in seconds. The default value is 300. Setting the value of this parameter below the default value may cause additional overhead with some workloads and is not recommended.
For more information about setting these parameters, see "Specifying Replay Options".