All you need to know about Oracle Real Application Testing (RAT) Part3

Dear Readers,

Trust you are doing well.

In my last post, I foucssed on RAT capture process.

In this post, I’ll delve into the process of preprocessing RAT workloads. This post will provide insights into key considerations, best practices, and essential MOS notes for RAT preprocessing.

WHAT IS PREPROCESSING?:

After a workload is captured and setup of the test system is complete, the captured data must be preprocessed.This is done by running DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE
Preprocessing a captured workload creates all necessary metadata for replaying the workload. It needs to be done only once for a captured workload and can then be replayed multiple times on any database of the same version as the database where preprocessing was performed. (i.e. as long as the version of the database is the same, the preprocessing does not need to be repeated). After preprocessing a captured workload, you can replay it on the test system.

You can create gauranteed restore point after preprocessing is done, so that you can flash back to this GRP and repeat RAT replay multiple times.

To preprocess a captured workload, all captured data files must be moved to a directory on the instance where the preprocessing is to be performed.
Preprocessing does not modify the captured files. It reads the *.rec files and creates the metadata neccesary for the replay in a subdirectory called: pp.

If the workload is pre-processed on 19.16.0.0.0, it will create the directory pp19.16.0.0.0.

The following files are created in the subdirectory:

wcr_login.pp
wcr_login.extb
wcr_seq_data.extb
wcr_conn_data.extb
wcr_data.extb
wcr_dep_graph.extb
wcr_commits.extb
wcr_references.extb
wcr_xa.extb
wcr_scn_order.extb
wcr_sqltext.extb
wcr_schema_info.extb
wcr_process.wmd
wcr_calibrate.xml

STEPS FOR RAT PREPROCESSING:

SQL> exec dbms_workload_replay.process_capture(capture_dir=> '',parallel_level => 1000016 )

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. Also the number of parallel processes = 16 and the preprocessing of object_ids is disabled.

By default, preprocessing is done in parallel. The parameter PARALLEL_LEVEL sets the number of worker processes spawned to do the preprocessing and by default is equal to the cpu_count.

ESTIMATIONS FOR RAT PREPROCESSING:

Time taken for RAT preprocessing completely depends on below factors:

  • Size of the capture
  • Number of files
  • CPU type and I/O throughput

You can get an idea/estimate of how much preprocessing has been done and how much time is left by running the following sqls:

SQL to calculate the percentage of the capture files that have been processed:

DECLARE
retval VARCHAR2(100);
BEGIN
retval := '-'||dbms_workload_replay.process_capture_completion||'-';
dbms_output.put_line(retval);
END;
/

SQL to calculate an estimate in minutes of time remaining before processing is completed.

DECLARE
retval VARCHAR2(100);
BEGIN
retval := '-'||dbms_workload_replay.process_capture_remaining_time||'-';
dbms_output.put_line(retval);
END;
/

Note: This is an estimate only and the reality may differ significantly from these estimates.

CONSIDERATIONS:

  • It is recommended to set the SYSTEM tablespace to autoextend while preprocessing in order to avoid the tablespace full errors.
  • Setting PARALLEL_LEVEL to a value greater than 1,000,000 will disable preprocessing of object_ids. This will help to significantly improve preprocessing speed.
  • Do not add any other files or do any kind of backups into the capture directory.
  • Do not create any additional directories in the capture directory.
  • If any *.rec files are removed from the capture directory as a workaround, than you must preprocess again before you do the next replay.
  • If the captured workload is corrupted, database alert log shows many incomplete/corrupted capture files being processed. In such cases fresh capture needs to be taken.

MOS REFERENCES:

In Part 4, I will elaborate on Workload replay procedure.

Let me know for any questions and any further information in comments or LinkedIn.

Regards
Adityanath.

3 replies

Leave a comment