Oracle rat-real application testing

Source: Internet
Author: User

As a new feature of Oracle 11g, rat aims to evaluate data performance. When we upgrade or modify some configurations for the database, we can compare the performance before and after the changes when changing the database server, so that the performance of the two can be comparable and practical. You need to first capture all operations in a certain time period in the production environment. Then replay them in the test environment.

1. Capture steps

  • Create a system directory, such as D: \ capture
  • Create an oracle Directory: create directory dir1 as 'd: \ capture'
  • Start Capture: dbms_workload_capture.start_capture (name => 'test', Dir => 'dir1'); (dir1 must be capitalized here)
  • Perform some operations in the database
  • End Capture: dbms_workload_capture.finish_capture;

    2. Preparations for Replay
    1. Copy the capture files on the target server to the tested server. Assume that a target D: \ capture is created on the tested server.
    2. Create an oracle Directory: create directory dir1 as 'd: \ capture'
    Process workload:Dbms_workload_replay.process_capture(Capture_dir => 'dir1 ′));

    • Initialize the replay
    Dbms_workload_replay.initialize_replay(Replay_name => 'play1 ′,Replay_dir => 'dir1 ′);

    • Prepare the replay
    Dbms_workload_replay.prepare_replay(Synchronization => false);Iii. Replay officially started:Copy the capture files to the local device. Assume that the files are also copied to D: \ capture. open cmd. run the command: WRC Arwen/Arwen @ ora11r2 mode = calibrate replaydir = 'd: \ capture; then run WRC Arwen/Arwen @ ora11r2 mode = replay replaydir = 'd: \ capture open another CMD and connect to the DB with sqlplus and then run exec dbms_workload_replay.start_replay. in the previous cmd, a message is displayed: replay started: Time replay finished: report generated after time REPLAY: declarel_cap_idnumber; l_rep_idnumber; v_rep_rptclob; reportfile utl_file.file_type; beginl_cap_id: =
    Dbms_workload_replay.get_replay_info(Dir
    => 'Dir1'); selectmax
    (ID) into l_rep_id
    From dba_workload_replayswhere capture_id = l_cap_id; v_rep_rpt: =
    Dbms_workload_replay.report(Replay_id => l_rep_id, format => 'html'); reportfile: = utl_file.fopen ('dir1', 'Report. HTML ', 'w', 32767); utl_file.put_line (reportfile, v_rep_rpt,
    True); utl_file.fclose (reportfile); end ).

     

     

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.