I've already mentioned on this blog very useful Consolidated Database Replay feature, for example while testing unified auditing performance impact (http://db-blog.web.cern.ch/blog/szymon-skorupinski/2014-06-unified-auditing-performance) or while investigating problems with hanging workload capture (http://db-blog.web.cern.ch/blog/szymon-skorupinski/2014-06-starting-workload-capture-hangs-it-really-problem-rat). But only recently I've found that along with this functionality, there was additional and again very handy capability introduced, allowing you to create a subset from already captured workload.
It helped me while I was working on designing automatic test procedure which is planned to be run every 2 weeks, in order to spot any possible impact coming from changes introduced in our test environment. During development phase I don't want to wait several hours to let whole test cycle to finish - it is enough just to run it for short period of time to spot any possible problems with the scripts. That's why out of 8 hours capture, I've generated subset containing only 15 minutes of workload. Please find below how easy it was:
$ mkdir /ORA/dbs77/RAT/RATCI_DB/shortened_capture SQL> create directory short_capture_dir as '/ORA/dbs77/RAT/RATCI_DB/shortened_capture'; SQL> exec dbms_workload_replay.generate_capture_subset( input_capture_dir => 'CAPTURE_DIR', output_capture_dir => 'SHORT_CAPTURE_DIR', new_capture_name => 'Shortened_for_RATCI_DB_15min', begin_time => 0, begin_include_incomplete => FALSE, end_time => 900, end_include_incomplete => false, parallel_level => 1); SQL> exec dbms_workload_replay.process_capture('SHORT_CAPTURE_DIR');
Afterwards you just have to follow usual steps needed to run the replay - pointing of course to shortened version of your capture.
If you want to play with this feature, please keep in mind two things. Firstly, if you want to use it on 11gR2, you have to backport it by installing patch 17411249 - please check more details in DBMS_WORKLOAD_REPLAY.GENERATE_CAPTURE_SUBSET does not Exist Prior to 220.127.116.11 (Doc ID 1631044.1).
Secondly, it seems that it is not yet fully functional, at least on our 18.104.22.168.0 installation, because when I've tried to use parallelism to increase capture processing performance, I've got following error:
SQL> exec dbms_workload_replay.generate_capture_subset( input_capture_dir => 'CAPTURE_DIR', output_capture_dir => 'SHORT_CAPTURE_DIR', new_capture_name => 'Shortened_for_RATCI_DB_15min', begin_time => 0, begin_include_incomplete => FALSE, end_time => 900, end_include_incomplete => false, parallel_level => 16); * ERROR at line 1: ORA-15522: failed to generate a workload capture subset: "parallel processing is not supported now. Please retry with parallel_leve 1 " ORA-06512: at "SYS.DBMS_WORKLOAD_REPLAY", line 3739 ORA-06512: at line 1
At least the message is honest :).