Adding Schedule Orders to Replay Schedules Using APIs

This section describes how to add schedule orders to and remove schedule orders from replay schedules using the DBMS_WORKLOAD_REPLAY package. For information about adding schedule orders to replay schedules, see "Adding Schedule Orders".

Before adding schedule orders to a replay schedule, ensure that the following prerequisites are met:

Note:

Adding schedule orders to a replay schedule is optional. If you do not add a schedule order to a replay schedule, then all workload captures added to the replay schedule will start to replay simultaneously when the consolidated replay begins.

To add schedule orders to a replay schedule:

  1. Use the ADD_SCHEDULE_ORDERING function:

    DBMS_WORKLOAD_REPLAY.ADD_SCHEDULE_ORDERING (
       schedule_capture_id IN VARCHAR2,
       wait_for_capture_id IN VARCHAR2)
    RETURN NUMBER;
    

    This function adds a schedule order between two workload captures that have been added to the replay schedule. If a schedule order cannot be added, it returns a non-zero error code.

  2. Set the schedule_capture_id parameter to the workload capture that you want to wait in this schedule order.

  3. Set the wait_for_capture_id parameter to the workload capture that you want to be completed before the other workload capture can start in this schedule order.

You can also use the DBMS_WORKLOAD_REPLAY package to remove schedule orders from a replay schedule.

To remove schedule orders from a replay schedule:

  1. Use the REMOVE_SCHEDULE_ORDERING procedure:

    DBMS_WORKLOAD_REPLAY.REMOVE_SCHEDULE ORDERING (
       schedule_capture_id IN VARCHAR2,
       wait_for_capture_id IN VARCHAR2);
    
  2. Set the schedule_capture_id parameter to the workload capture waiting in this schedule order.

  3. Set the wait_for_capture_id parameter to the workload capture that needs to be completed before the other workload capture can start in this schedule order.

To view schedule orders:

  • Use the DBA_WORKLOAD_SCHEDULE_ORDERING view.

See Also: