First create a directory for the capture to save files SQL> Create directory wloadcap as '/opt/oracle/workload

'; Optionally we add a filter to allow the inclusion or exclusion of a user(schema) ,module,action ,program ,service or instance from the capture. Start the capture. SQL> exec dbms_workload_capture.start_capture(name=>'OOW07',dir=>'WLOADCAP',defa ult_action=>'EXCLUDE') SQL> Select id, name, status from dba_workload_captures; Allow work to transpire , then end the capture. SQL> exec dbms_workload_capture.finish_capture; Export the AWR of the id obtained from dba_workload_captures table BEGIN DBMS_WORKLOAD_CAPTURE.EXPORT_AWR (capture_id =><id>); END; / Obtain the start SCN of the capture (This is required to know the exact SCN to w hich you should recover your target or "replay" databased prior to performing re play) SQL> Select name, start_scn from dba_workload_captures; The SCN obtained from the previous step is used to recover your target or replay database prior to performing replay. RMAN >duplicate target database to clonedb from active database until scn <scn> spfile nofilenamecheck Moving the workload is as simple as copying the contents of the capture director y to the testing host $ scp /opt/oracle/workload/* clonedb.host:/opt/oracle/workload/ The next step is to process , initialize and prepare the capture data on replay database SQL> exec dbms_workload_replay.process_capture(capture_dir=>'WLOADCAP') The next step is to set up replay clients and calibrating replay clients.The def ault mode is replay but the first time it has to be run in calibrate mode. $ wrc mode=calibrate replaydir=/opt/oracle/workload SQL> exec dbms_workload_replay.initialize_replay(replay_name=>'OOW07',replay_dir

END.GET_REPLAY_INFO(dir => 'WLOADCAP').For most s cenarios.These processes log into the replay database and monitor the status of the replay job . alter database open resetlogs. dbms_output.export_awr(replay_id=><id>). waiting to start replay until the rep lay is started from the database side. / The final step in database replay process is to analyze the replay workload by g enerating a workload capture report. flashback database to scn <scn>. start the Workload replay clients.start_replay Exporting AWR data for Workload Replay and to do the export get the replay id SQL> Select id from dba_workload_replays.flashback ans start all over again. BEGIN rep_id := DBMS_WORKLOAD_REPLAY.=>'WLOADCAP') Set workload replay options SQL> exec dbms_workload_replay. / Important Note A series of changes . DECLARE rep_rpt CLOB. format => 'TEXT'). startup mount. a more realistic load can be produced using separate hosts.The worklo ad can be generated from the local database host or separate machines. modifications or parameter settings may be tested one afte r another if you use Flashback Logging or Flashback Database. End.Starting these client proces ses does not begin the replay.put_line(rep_rpt). then simply make more changes . rep_rpt := DBMS_WORKLOAD_REPLAY.prepare_replay(synchronization=>TRUE) On the workload generation host(s). Export the AWR once you have obtained the id from dba_workload_replays table SQL> Begin dbms_workload_replay. export any performance statistics you want to analyze for comparis on .REPORT(replay_id => rep_id. $ wrc userid=system password=tea4two replaydir=/opt/oracle/workload workdir=/tm p The next call from the replay database actually starts the replay SQL> exec dbms_workload_replay. SQL> SQL> SQL> SQL> shutdown immediate.After one replay is complete . .

Sign up to vote on this title
UsefulNot useful