Skip Headers
Oracle® Database Real Application Testing User's Guide
11g Release 2 (11.2)

E41481-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

10 Preprocessing a Database Workload

After a workload is captured and setup of the test system is complete, the captured data must be preprocessed. Preprocessing a captured workload creates all necessary metadata for replaying the workload. This must be done once for every captured workload before they can be replayed. After the captured workload is preprocessed, it can be replayed repeatedly on a replay system.

To preprocess a captured workload, you will first need to move all captured data files from the directory where they are stored on the capture system to a directory on the instance where the preprocessing will be performed. Preprocessing is resource intensive and should be performed on a system that is:

For Oracle Real Application Clusters (Oracle RAC), select one database instance of the replay system for the preprocessing. This instance must have access to the captured data files that require preprocessing, which can be stored on a local or shared file system. If the capture directory path on the capture system resolves to separate physical directories in each instance, you will need to move all the capture files created in each of these directories into a single directory on which preprocessing will be performed.

Typically, you will preprocess the captured workload on the replay system. If you plan to preprocess the captured workload on a system that is separate from the replay system, you will also need to move all preprocessed data files from the directory where they are stored on the preprocessing system to a directory on the replay system after preprocessing is complete.

This chapter contains the following sections:

Tip:

Before you can preprocess a captured workload, you need to capture the workload on the production system, as described in Chapter 9, "Capturing a Database Workload".

10.1 Preparing a Single Database Workload Using Enterprise Manager

Preparing for a single workload consists of the following tasks:

  • Creating a database replay task

  • Creating a replay from a replay task

  • Preparing the test database

  • Preprocessing the workload and deploying the replay clients

Note:

Preparing the test database is only required if you have not done so already.

The following sections provide procedures for these tasks.

10.1.1 Creating a Database Replay Task

Before proceeding, the capture that you want to replay must have some captured user calls.

To create a database replay task: 

  1. From the Database Replay page, click the Replay Tasks tab, then click Create in the toolbar.

    The Create Task page appears.

    Description of dbr_replay_create_task.gif follows
    Description of the illustration dbr_replay_create_task.gif

  2. Provide a Name for the task, select a capture to be replayed, then click Submit. For consolidated replays, select two or more captures.

    The Database Replay page reappears, and displays your newly created replay task in the table under the Replay Task tab.

    Description of dbr_replay_create_tsk_comp.gif follows
    Description of the illustration dbr_replay_create_tsk_comp.gif

10.1.2 Creating a Replay from a Replay Task

To create the replay: 

  1. From the Database Replay page, click the Replay Tasks tab.

  2. Click the link for the desired replay task in the table.

    The Replay Task page for the capture appears.

    Description of dbr_replay_create_replay.gif follows
    Description of the illustration dbr_replay_create_replay.gif

  3. Click Create in the Replays section.

    The Create Replay pop-up appears.

  4. Provide a required Name and optional description, then click the Target Database icon.

    The Search and Select: Targets pop-up appears.

  5. Choose the desired database, then click Select.

  6. Click OK in the Create Replay pop-up.

    The Database Replay page for your replay appears, which includes a Task List with links to perform the needed tasks.

    Description of dbr_replay_create_rep_nm.gif follows
    Description of the illustration dbr_replay_create_rep_nm.gif

You can now proceed to the first task in the Task List, described in the next section.

10.1.3 Preparing the Test Database

Preparing the test database consists of:

  • Setting up the test database

  • Isolating the test database

Note:

These tasks are optional. If you have already set up your test database, skip to "Preprocessing the Workload and Deploying the Replay Clients".

The following procedures explain how to perform each of these tasks, which you can do in any order.

To set up the test database: 

  1. From the Replay page for your particular replay, click the link for the Set Up Test Database task.

    The Set Up Test Database page appears.

    Description of dbr_process_setup_db.gif follows
    Description of the illustration dbr_process_setup_db.gif

  2. Choose whether you want to upgrade the database or not, and indicate whether this is a cluster database.

  3. Click the Go to Task icon for the Clone Existing Database Software sub-task, or click Enable All Tasks if you want to create the test database first.

  4. Follow the instructions provided in the online help for the wizards.

    When the tasks are complete, a checkmark appears in the Status column for each task.

  5. Click OK to return to the Database Replay page.

To isolate the test database: 

  1. From the Replay page for your particular replay, click the link for the Isolate Test Database task.

    A page appears explaining that references to external systems can cause problems during the replay.

    Description of dbr_process_isolate_db.gif follows
    Description of the illustration dbr_process_isolate_db.gif

  2. Use the links provided to verify potential references to external systems, modify those that are invalid, then click OK.

    The Replay Summary page reappears.

10.1.4 Preprocessing the Workload and Deploying the Replay Clients

The final preparation for the replay consists of:

  • Preprocessing the workload

    You need to preprocess each captured workload once for each version of the database against which the workload will be replayed. After you preprocess the workload once, you can use it for any subsequent replay tasks and replays without needing to preprocess again, as long as the test database is the same version as the database where the workload was preprocessed.For instance, for a replay task that contains two replays named "MyReplay1" and "MyReplay2," after you have preprocessed "MyReplay1", you can just directly reuse the directory object to replay "MyReplay2."

    The Workload Analyzer report is available after preprocessing.

  • Deploying the replay clients

    You do not need to deploy the replay clients to other replay client hosts if these hosts can access the Oracle home of the test database you specified in the Database Target Name field.

The following procedures explain how to accomplish each of these tasks.

To preprocess the workload: 

  1. From the Replay page for your particular replay, click the link for the Preprocess Workload task.

    The Preprocess Captured Workload: Locate Workload page appears.

    Description of dbr_process_locate_wkload.gif follows
    Description of the illustration dbr_process_locate_wkload.gif

  2. Select the desired workload location option, then click Next.

    Note:

    You initially need to select the copy option.

    The Preprocess Captured Workload: Copy Workload page appears.

    Description of dbr_process_copy_wkld.gif follows
    Description of the illustration dbr_process_copy_wkld.gif

  3. Provide the required credentials and the new location to which the workloads will be copied and preprocessed, then click Next.

    The system responds by displaying a progress bar graph during processing, then displays the Preprocess Captured Workload: Select Directory page after the copy operation concludes.

    Description of dbr_process_select_dir.gif follows
    Description of the illustration dbr_process_select_dir.gif

  4. Specify the Directory Object, or create a new Directory Object that points to the location that contains the workload. If you chose to copy from the workload location to a new location in the previous step, make sure that the directory object points to the exact location you specified in the New Location of the Workload Directory section.

    The system responds by displaying a Capture Summary. You can now expand the Capture Details section to see the workload profile and workload filters. The Capture Summary does not appear for consolidated replays.

    Click Next to display the Preprocess Captured Workload: Schedule page.

  5. Provide input to schedule the preprocess job:

    1. Provide your own required job name or accept the system-supplied name. The job system automatically names the job in uppercase.

    2. Indicate whether you want the job to run as soon as you submit it, or whether you want it to run at a later time.

    3. Provide the host credentials, which are used to run the preprocess job in the operating system.

    Click Next to display the Preprocess Captured Workload: Review page.

  6. Check to make sure that the settings are what you intend, then click Submit.

    The Database Replay page appears, and assuming that there were no errors in your input, a confirmation message at the top of the page states "Job JOBNAME to prepare the workload has been created successfully."

  7. Click the JOBNAME link to check the status of the job. The job must succeed before you can proceed to the Replay Workload task.

    Note:

    A message may appear in the Task List stating that you need to install an additional PL/SQL package in the test database to generate a compare period report after the trial. Click Install PL/SQL Package to resolve this issue before proceeding to the Replay Workload task.

    Tip:

    After preprocessing a captured workload, you can replay it on the test system, as described in Chapter 11, "Replaying a Database Workload".

To deploy the replay clients: 

  1. From the Replay page for your particular replay, click the link for the Deploy Replay Clients task.

    The Deploy Replay Clients page appears.

    Description of dbr_process_deploy_clients.gif follows
    Description of the illustration dbr_process_deploy_clients.gif

  2. Accept the default values defined for the associated workload capture, or override these values, then click Continue.

    The Provision Oracle Database Client wizard appears.

  3. Follow the instructions provided in the online help for each step of the wizard.

    After you click Submit in the Review step to run the deployment procedure according to the schedule you have set, the Replay Summary page reappears.

10.2 Preprocessing a Database Workload Using APIs

This section describes how to preprocess a captured workload using the DBMS_WORKLOAD_REPLAY package. You can also use Oracle Enterprise Manager to preprocess a captured workload, as described in "Preparing a Single Database Workload Using Enterprise Manager".

To preprocess a captured workload, use the PROCESS_CAPTURE procedure:

BEGIN
  DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE (capture_dir => 'dec06');
END;
/

In this example, the captured workload stored in the dec06 directory will be preprocessed.

The PROCESS_CAPTURE procedure in this example uses the capture_dir required parameter, which specifies the directory that contains the captured workload to be preprocessed.

Tip:

After preprocessing a captured workload, you can replay it on the test system, as described in Chapter 11, "Replaying a Database Workload".

See Also:

10.2.1 Running the Workload Analyzer Command-Line Interface

The Workload Analyzer is a Java program that analyzes a workload capture directory and identifies parts of a captured workload that may not replay accurately due to insufficient data, errors that occurred during workload capture, or usage features that are not supported by Database Replay. The results of the workload analysis are saved to an HTML report named wcr_cap_analysis.html located in the capture directory that is being analyzed. If an error can be prevented, the workload analysis report displays available preventive actions that can be implemented before replay. If an error cannot be corrected, the workload analysis report provides a description of the error so it can be accounted for during replay. Running Workload Analyzer is the default option and is strongly recommended.

Note:

If you are preprocessing a workload capture using Oracle Enterprise Manager, then you do not need to run Workload Analyzer in the command-line interface. Oracle Enterprise Manager enables you to run Workload Analyzer as part of the workload preprocessing.

Workload Analyzer is composed of two JAR files, dbranalyzer.jar and dbrparser.jar, located in the $ORACLE_HOME/rdbms/jlib/ directory of a system running Oracle Database Enterprise Edition Release 11.2.0.2 or higher. Workload Analyzer requires Java 1.5 or higher and the ojdbc6.jar file located in the $ORACLE_HOME/jdbc/lib/ directory. To run Workload Analyzer in the command-line interface, run the following java command on a single line:

java -classpath
$ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/dbrparser.jar:
$ORACLE_HOME/rdbms/jlib/dbranalyzer.jar:
oracle.dbreplay.workload.checker.CaptureChecker
<capture_directory> <connection_string>

For the capture_directory parameter, input the operating system path of the capture directory. This directory should also contain the exported AWR data for the workload capture. For the connection_string parameter, input the connection string of an Oracle database that is release 11.1 or higher.

The Workload Analyzer program will then prompt you to input the username and password of a database user with EXECUTE privileges for the DBMS_WORKLOAD_CAPTURE package and the SELECT_CATALOG role on the target database.

An example of this command may be:

java -classpath
$ORACLE_HOME/jdbc/lib/ojdbc6.jar:$ORACLE_HOME/rdbms/jlib/dbrparser.jar:
$ORACLE_HOME/rdbms/jlib/dbranalyzer.jar:
oracle.dbreplay.workload.checker.CaptureChecker /scratch/capture
jdbc:oracle:thin:@myhost.mycompany.com:1521:orcl