{"id":182,"date":"2017-01-07T22:07:40","date_gmt":"2017-01-07T14:07:40","guid":{"rendered":"http:\/\/www.rao-bing.cn\/?p=182"},"modified":"2020-01-06T16:13:06","modified_gmt":"2020-01-06T08:13:06","slug":"database-replay-and-consolidated-database-replay","status":"publish","type":"post","link":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/07\/182\/","title":{"rendered":"Database Replay\u548cConsolidated Database replay"},"content":{"rendered":"<h3>\u7b80\u4ecb<\/h3>\n<p>\u5728\u6570\u636e\u5e93\u7684\u8fc1\u79fb\u548c\u5347\u7ea7\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e00\u4e2a\u95ee\u9898\uff1a\u5728\u505a\u538b\u529b\u6d4b\u8bd5\u65f6\uff0c\u5982\u4f55\u6a21\u62df\u771f\u5b9e\u7684\u4e1a\u52a1\u538b\u529b\uff0c\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u6bd4\u5982\uff1a\u5e94\u7528\u65b9\u5f00\u53d1\u6a21\u62df\u7a0b\u5e8f\u6216\u8005\u4f7f\u7528\u538b\u529b\u6d4b\u8bd5\u5de5\u5177\u6a21\u62df\uff0c\u5982load runner\uff0c\u4f46\u662f\uff0c\u5982\u679c\u8981\u8bf4\u54ea\u79cd\u65b9\u6cd5\u80fd\u6700\u5927\u9650\u5ea6\u5730\u6a21\u62df\u771f\u5b9e\u4e1a\u52a1\u538b\u529b\uff0c\u6211\u8ba4\u4e3a\u8fd8\u662fOracle\u7684Database Replay\uff08\u6570\u636e\u5e93\u91cd\u653e\uff09\u529f\u80fd\uff0cDatabase Replay\u529f\u80fd\u662fReal Application Testing\u7684\u4e00\u90e8\u5206\uff0c\u5b83\u7684\u57fa\u672c\u539f\u7406\u56fe\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1407_DatabaseRep1.png\" alt=\"\" \/><\/p>\n<p>\u7b80\u5355\u8bf4\uff0cDatabase Replay\u53ef\u4ee5\u5728\u751f\u4ea7\u6570\u636e\u5e93\u4e0a&#8221;\u6355\u83b7&#8221;\u8d1f\u8f7d\uff08workload capture\uff09\uff0c\u4fdd\u5b58\u6210\u4e00\u5b9a\u683c\u5f0f\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u3002\u5c06\u4fdd\u5b58\u7684\u8d1f\u8f7d\u6587\u4ef6\u590d\u5236\u5230\u6d4b\u8bd5\u73af\u5883\uff0c\u7ecf\u8fc7\u4e00\u5b9a\u7684\u5904\u7406\u540e\uff0c\u5c31\u53ef\u4ee5\u5728\u6d4b\u8bd5\u73af\u5883&#8221;\u91cd\u653e&#8221;\u8d1f\u8f7d\uff08workload replay\uff09\uff0c\u4ece\u800c\u8fbe\u5230\u6a21\u62df\u771f\u5b9e\u538b\u529b\uff0c\u8fdb\u884c\u538b\u529b\u6d4b\u8bd5\u7684\u76ee\u7684\u3002<\/p>\n<p>Database Replay\u662f11g\u624d\u6709\u7684\u7279\u6027\uff0c\u4f46\u662f\uff0c\u8d1f\u8f7d\u7684\u6355\u83b7\uff0c\u652f\u630110.2.0.4\u4e4b\u540e\u7684\u6570\u636e\u5e93\uff0c\u8fd9\u4e00\u70b9\u4e5f\u6b63\u597d\u7b26\u5408\u56fd\u5185\u5f88\u591a\u5ba2\u6237\u7684\u9700\u6c42\uff0c\u56e0\u4e3a\u56fd\u5185\u8fd8\u6709\u76f8\u5f53\u4e00\u90e8\u5206\u5ba2\u6237\uff0c\u56e0\u4e3a\u7a33\u59a5\u8d77\u89c1\uff0c\u7cfb\u7edf\u8fd8\u90fd\u4e00\u76f4\u8fd0\u884c\u572810gR2\u7248\u672c\u7684Oracle\u6570\u636e\u5e93\u4e0a\uff0c\u90fd\u6709\u5347\u7ea7\u7684\u9700\u6c42\u3002<\/p>\n<p>Consolidated Database Replay \u662f11.2.0.2\u4e4b\u540e\u624d\u51fa\u73b0\u7684\u529f\u80fd\uff0c\u5b57\u9762\u610f\u601d\u662f\u6574\u5408\u7684\u6570\u636e\u5e93\u91cd\u653e\uff0c\u5b83\u53ef\u4ee5\u5c06\u4e0d\u540c\u7cfb\u7edf&#8221;\u6355\u83b7&#8221;\u7684\u8d1f\u8f7d\uff0c\u6574\u5408\u5230\u4e00\u8d77\u91cd\u653e\uff0c\u9002\u7528\u4e8e\u6570\u636e\u5e93\u6574\u5408\u6d4b\u8bd5\u548cScale-Up\u6d4b\u8bd5\u3002<\/p>\n<p>\u540e\u9762\u6211\u4eec\u7528\u5b9e\u9a8c\u6765\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0bDatabase Replay\u7684\u76f8\u5173\u529f\u80fd\uff0c\u5b9e\u9a8c\u91c7\u752810.2.0.5\u4f5c\u4e3a\u8d1f\u8f7d\u7684\u6355\u83b7\u7aef\uff0c\u752812.1.0.2\u4f5c\u4e3a\u8d1f\u8f7d\u7684\u91cd\u653e\u7aef\u3002<\/p>\n<h3>\u51c6\u5907\u5de5\u4f5c\uff08\u5b89\u88c5Database Replay\u76f8\u5173\u8865\u4e01\uff09<\/h3>\n<p>\u9996\u5148\u8981\u6839\u636e\u6587\u6863 Mandatory Patches for Database Testing Functionality for Current and Earlier Releases (Doc ID 560977.1)\uff0c\u68c0\u67e5\u8be5\u6253\u7684\u8865\u4e01\u662f\u5426\u6253\u8fc7\u4e86\u3002\u6355\u83b7\u7aef\u548c\u91cd\u653e\u7aef\u90fd\u8981\u6253\u3002<\/p>\n<h3>\u8d1f\u8f7d\u7684\u6355\u83b7<\/h3>\n<p>\u6355\u83b7\u7aef\u662f\u4e00\u4e2a\u5b89\u88c5\u5728OL5.9\u4e0a\u768410.2.0.5\uff0c\u6570\u636e\u5e93SID\u662ftest1.<\/p>\n<h4>\u521b\u5efa\u76ee\u5f55<\/h4>\n<p>\u5728OS\u521b\u5efa\u76ee\u5f55\u5e76\u521b\u5efa\u76f8\u5e94\u7684\u6570\u636e\u5e93\u76ee\u5f55\u5bf9\u8c61\uff0c\u7528\u4e8e\u4fdd\u5b58\u8d1f\u8f7d\u6570\u636e\uff1a<\/p>\n<p>$ cd \/u01\/app\/oracle<\/p>\n<p>$ mkdir wrc_dir1<\/p>\n<p>SQL&gt;CREATE OR REPLACE DIRECTORY wrc_dir1 AS &#8216;\/u01\/app\/oracle\/wrc_dir1\/&#8217;;<\/p>\n<h4>\u6253\u5f0010gR2\u7684Workload Capture \u652f\u6301<\/h4>\n<p>\u867d\u7136Database Replay\u652f\u630110.2.0.4\u4ee5\u4e0a\u7684\u7248\u672c\u8fdb\u884c\u8d1f\u8f7d&#8221;\u6355\u83b7&#8221;\uff0c\u4f46\u662f10gR2\u7684\u6570\u636e\u5e93\u8981\u60f3\u6b63\u5e38\u4f7f\u7528\u8fd9\u4e2a\u529f\u80fd\uff0c\u9700\u8981\u5bf9\u6570\u636e\u5e93\u8bbe\u7f6e\u4e00\u4e2a\u521d\u59cb\u5316\u53c2\u6570\uff0c\u8054\u673a\u6587\u6863\u4e0a\u8bb2\u9700\u8981\u8fd0\u884c\u811a\u672c$ORACLE_HOME\/rdbms\/admin\/wrrenbl.sql\uff0c\u5176\u5b9e\u8fd9\u4e2a\u811a\u672c\u53ea\u505a\u4e00\u4ef6\u4e8b\uff0c\u5c31\u662f\u8bbe\u7f6e\u521d\u59cb\u5316\u53c2\u6570PRE_11G_ENABLE_CAPTURE=true\u3002<\/p>\n<p style=\"background: #d9d9d9;\">[oracle@test10g ~]$ sqlplus &#8220;\/ as sysdba&#8221;<\/p>\n<p style=\"background: #d9d9d9;\">SQL*Plus: Release 10.2.0.5.0 &#8211; Production on Fri Dec 23 10:57:26 2016<\/p>\n<p style=\"background: #d9d9d9;\">Copyright (c) 1982, 2010, Oracle. All Rights Reserved.<\/p>\n<p style=\"background: #d9d9d9;\">Connected to:<\/p>\n<p style=\"background: #d9d9d9;\">Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 &#8211; 64bit Production<\/p>\n<p style=\"background: #d9d9d9;\">With the Partitioning, OLAP, Data Mining and Real Application Testing options<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; @?\/rdbms\/admin\/wrrenbl.sql<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; SET FEEDBACK 1<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; SET NUMWIDTH 10<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; SET LINESIZE 80<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; SET TRIMSPOOL ON<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; SET TAB OFF<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; SET PAGESIZE 100<\/p>\n<p style=\"background: #d9d9d9;\">SQL&gt; alter system set PRE_11G_ENABLE_CAPTURE=true sid=&#8217;*&#8217;;<\/p>\n<p style=\"background: #d9d9d9;\">System altered.<\/p>\n<p>\u4fee\u6539\u540e\u9700\u8981\u91cd\u542f\u6570\u636e\u5e93\uff0c\u4e0d\u4ec5\u4ec5\u4e3a\u4e86\u8ba9\u53c2\u6570\u751f\u6548\uff0c\u4e5f\u662f\u4e3a\u4e86\u8ba9\u6240\u6709\u4f1a\u8bdd\u90fd\u91cd\u65b0\u8fde\u63a5\u3002<\/p>\n<h4>\u521b\u5efa\u5b9e\u9a8c\u7528\u6237\u548c\u5bf9\u8c61<\/h4>\n<p>\u521b\u5efa\u6570\u636e\u5e93\u7528\u6237app1\uff0c\u5e76\u5728app1 schema\u4e2d\u521b\u5efa\u8868test_table1:<\/p>\n<p>SQL&gt;create table test_table1 (col1 number, col2 varchar2(20));<\/p>\n<h4>\u5f00\u59cb\u6355\u83b7\u8d1f\u8f7d<\/h4>\n<p>\u4f7f\u7528sys\u7528\u6237\u6267\u884c\uff1a<\/p>\n<p style=\"background: #d9d9d9;\">BEGIN<\/p>\n<p style=\"background: #d9d9d9;\">DBMS_WORKLOAD_CAPTURE.start_capture (name =&gt; &#8216;test1_cap&#8217;,<\/p>\n<p style=\"background: #d9d9d9;\">dir =&gt; &#8216;WRC_DIR1&#8217;,<\/p>\n<p style=\"background: #d9d9d9;\">duration =&gt; NULL);<\/p>\n<p style=\"background: #d9d9d9;\">END;<\/p>\n<p style=\"background: #d9d9d9;\">\/<\/p>\n<h4>\u6a21\u62df\u8d1f\u8f7d<\/h4>\n<p>\u4f7f\u7528app1 \u7528\u6237\u767b\u5f55\u6570\u636e\u5e93\uff0c\u6267\u884c\uff1a<\/p>\n<p style=\"background: #d9d9d9;\">begin<\/p>\n<p style=\"background: #d9d9d9;\">for i in 1..10000 loop<\/p>\n<p style=\"background: #d9d9d9;\">insert into test_table1 values(i,&#8217;test1:&#8217;||i);<\/p>\n<p style=\"background: #d9d9d9;\">end loop;<\/p>\n<p style=\"background: #d9d9d9;\">commit;<\/p>\n<p style=\"background: #d9d9d9;\">end;<\/p>\n<p style=\"background: #d9d9d9;\">\/<\/p>\n<p>\u5728test_table1\u8868\u4e2d\u63d2\u516510000\u6761\u8bb0\u5f55\u3002<\/p>\n<p>\u7136\u540e\u65ad\u5f00\u4f1a\u8bdd\u3002<\/p>\n<h4>\u505c\u6b62\u6355\u83b7\u8d1f\u8f7d<\/h4>\n<p>SQL&gt;exec dbms_workload_capture.finish_capture;<\/p>\n<h3>\u8d1f\u8f7d\u7684\u91cd\u653e<\/h3>\n<p>\u91cd\u653e\u7aef\u662f\u4e00\u4e2a\u5b89\u88c5\u5728OL7.1\u4e0a\u768412.1.0.2\u6570\u636e\u5e93\uff0c\u6570\u636e\u5e93SID\u662ftest3\u3002<\/p>\n<h4>\u51c6\u5907\u5de5\u4f5c<\/h4>\n<p>\u521b\u5efa\u76ee\u5f55\u53ca\u6570\u636e\u5e93\u5bf9\u8c61\uff1a<\/p>\n<p>$ mkdir \u2013p \/u01\/app\/oracle\/con_dir\/wrc_dir1<\/p>\n<p>SQL&gt;CREATE OR REPLACE DIRECTORY wrc_dir1 AS &#8216;\/u01\/app\/oracle\/con_dir\/wrc_dir1\/&#8217;;<\/p>\n<p>\u590d\u5236\u6355\u83b7\u7684\u8d1f\u8f7d\u6587\u4ef6\u5230\/u01\/app\/oracle\/con_dir\/wrc_dir1\u4e0b\u3002<\/p>\n<p>\u5728\u91cd\u653e\u7aef\u521b\u5efaapp1\u7528\u6237\uff0c\u5e76\u521b\u5efa\u548c\u6355\u83b7\u7aef\u76f8\u540c\u7ed3\u6784\u7684\u8868test_table1\u3002<\/p>\n<h4>\u5904\u7406\u8d1f\u8f7d\u6587\u4ef6<\/h4>\n<p>\u7528SYS\u7528\u6237\u6267\u884c\uff1a<\/p>\n<p>BEGIN<\/p>\n<p>DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE (capture_dir =&gt; &#8216;WRC_DIR1&#8217;, parallel_level=&gt;1);<\/p>\n<p>END;<\/p>\n<p>\/<\/p>\n<p>BEGIN<\/p>\n<p>DBMS_WORKLOAD_REPLAY.INITIALIZE_REPLAY (replay_name =&gt; &#8216;replay1&#8217;,<\/p>\n<p>replay_dir =&gt; &#8216;WRC_DIR1&#8217;);<\/p>\n<p>END;<\/p>\n<p>\/<\/p>\n<p>exec dbms_workload_replay.prepare_replay ;<\/p>\n<h4>\u542f\u52a8WRC\u5ba2\u6237\u7aef<\/h4>\n<p>WRC\u5ba2\u6237\u7aef\u662f\u8d1f\u8d23\u8bfb\u53d6\u8d1f\u8f7d\u6587\u4ef6\uff0c\u91cd\u653e\u8d1f\u8f7d\u7684\u7a0b\u5e8f\u4e3b\u4f53\u3002\u91cd\u653e\u9664\u4e86\u5728SQL\u73af\u5883\u4e2d\u53d1\u51fa\u6307\u4ee4\uff0c\u8fd8\u9700\u8981WRC\u5ba2\u6237\u7aef\u7684\u914d\u5408\u3002\u542f\u52a8WRC\u5ba2\u6237\u7aef\u7684\u547d\u4ee4\uff1a<\/p>\n<p>$ wrc system\/welcome1 mode=replay replaydir=.\/wrc_dir1<\/p>\n<h4>\u542f\u52a8\u91cd\u653e<\/h4>\n<p>SQL&gt; exec dbms_workload_replay.start_replay;<\/p>\n<p>WRC\u5ba2\u6237\u7aef\u9000\u51fa\u624d\u6807\u5fd7\u91cd\u653e\u5b8c\u6210\uff0c\u4e0b\u9762\u662f\u5b9e\u9645\u6267\u884c\u7684\u8f93\u51fa\uff1a<\/p>\n<p style=\"background: #d9d9d9;\">[oracle@ol71vm1 con_dir]$ wrc system\/welcome1 mode=replay replaydir=.\/wrc_dir1<\/p>\n<p style=\"background: #d9d9d9;\">Workload Replay Client: Release 12.1.0.2.0 &#8211; Production on Sun Jan 1 20:46:15 2017<\/p>\n<p style=\"background: #d9d9d9;\">Copyright (c) 1982, 2014, Oracle and\/or its affiliates. All rights reserved.<\/p>\n<p style=\"background: #d9d9d9;\">Wait for the replay to start (20:46:15)<\/p>\n<p style=\"background: #d9d9d9;\">Replay client 1 started (20:46:45)<\/p>\n<p style=\"background: #d9d9d9;\">Replay client 1 finished (20:50:27)<\/p>\n<p>\u8fd9\u65f6\u6211\u4eec\u80fd\u591f\u770b\u5230\u91cd\u653e\u7aefapp1\u7528\u6237test_table1\u8868\u4e2d\u88ab\u63d2\u5165\u4e8610000\u6761\u8bb0\u5f55\uff0c\u8bf4\u660e\u8d1f\u8f7d\u88ab\u6b63\u786e\u5730\u91cd\u653e\u4e86\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5b8c\u6210\u540e\u53ef\u4ee5\u67e5\u770b\u91cd\u653e\u62a5\u544a\uff0c\u53d6\u5f97\u62a5\u544a\u7684\u547d\u4ee4\uff1a<\/p>\n<p>SQL&gt;set pagesize 0 long 30000000 longchunksize 2000 linesize 155<\/p>\n<p>SQL&gt;select DBMS_WORKLOAD_REPLAY.REPORT(replay_id =&gt; 71, format =&gt; &#8216;HTML&#8217;) from dual;<\/p>\n<p>\u5f53\u7136\uff0c\u8981\u60f3\u505a\u66f4\u8be6\u7ec6\u7684\u5206\u6790\uff0c\u8fd8\u662f\u770b\u76f8\u5e94\u65f6\u95f4\u6bb5\u7684AWR\u62a5\u544a\u6bd4\u8f83\u597d\u3002<\/p>\n<h3>Consolidated Database Replay<\/h3>\n<h4>\u6574\u5408\u573a\u666f<\/h4>\n<p>\u6bd4\u5982\u6709\u4e24\u4e2aAPP\uff0c\u5206\u522b\u8fd0\u884c\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u4e0a\uff0c\u5ba2\u6237\u5e0c\u671b\u5c06\u4e24\u4e2a\u5e94\u7528\u6574\u5408\u5230\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\uff0c\u4f46\u662f\u4e0d\u77e5\u9053\u65b0\u6570\u636e\u5e93\u662f\u5426\u80fd\u627f\u53d7\u4f4f\u538b\u529b\u3002\u90a3\u4e48\u5c31\u53ef\u4ee5\u7528Consolidated Database Replay\u6765\u6a21\u62df\u6d4b\u8bd5\u4e00\u4e0b\u3002<\/p>\n<h5>\u6355\u83b7\u7aef\u51c6\u5907\u5de5\u4f5c<\/h5>\n<p>\u524d\u9762\u7684\u4f8b\u5b50\u6211\u4eec\u505a\u7684\u6355\u83b7\u662f\u4ece\u6570\u636e\u5e93test1\u4e0a\u505a\u7684\uff0c\u6211\u4eec\u518d\u521b\u5efa\u53e6\u4e00\u4e2a10.2.0.5\u7684\u6570\u636e\u5e93\u53ebtest2\uff0c\u5728test2\u4e0a\u4e5f\u6355\u83b7\u4e00\u4efd\u8d1f\u8f7d\u3002<\/p>\n<p>$ cd \/u01\/app\/oracle<\/p>\n<p>$ mkdir wrc_dir2<\/p>\n<p>\u5728test2\u6570\u636e\u5e93\u4e2d\u6267\u884c\uff1a<\/p>\n<p>SQL&gt;CREATE OR REPLACE DIRECTORY wrc_dir2 AS &#8216;\/u01\/app\/oracle\/wrc_dir2\/&#8217;;<\/p>\n<p>\u521b\u5efa\u6570\u636e\u5e93\u7528\u6237app2\uff0c\u5e76\u5728app2 schema\u4e2d\u521b\u5efa\u8868test_table2:<\/p>\n<p>SQL&gt;create table test_table2 (col1 number, col2 varchar2(20));<\/p>\n<p>\u4fee\u6539\u521d\u59cb\u5316\u53c2\u6570\uff0c\u91cd\u542ftest2\u6570\u636e\u5e93\u3002<\/p>\n<h5>\u5f00\u59cb\u6355\u83b7<\/h5>\n<p>\u7528\u6237SYS\u7528\u6237\u6267\u884c\uff1a<\/p>\n<p>BEGIN<\/p>\n<p>DBMS_WORKLOAD_CAPTURE.start_capture (name =&gt; &#8216;test2_cap&#8217;,<\/p>\n<p>dir =&gt; &#8216;WRC_DIR2&#8217;,<\/p>\n<p>duration =&gt; NULL);<\/p>\n<p>END;<\/p>\n<p>\/<\/p>\n<h5>\u6a21\u62df\u538b\u529b<\/h5>\n<p>\u7528app2\u7528\u6237\u767b\u5f55\u6570\u636e\u5e93test2\uff0c\u6267\u884c\u4e0b\u9762\u7684\u811a\u672c\u6a21\u62df\u538b\u529b\uff1a<\/p>\n<p>begin<\/p>\n<p>for i in 1..10000 loop<\/p>\n<p>insert into test_table2 values(i,&#8217;test2:&#8217;||i);<\/p>\n<p>end loop;<\/p>\n<p>commit;<\/p>\n<p>end;<\/p>\n<p>\/<\/p>\n<p>\u7136\u540e\u65ad\u5f00\u8fde\u63a5\u3002<\/p>\n<h5>\u505c\u6b62\u6355\u83b7<\/h5>\n<p>SQL&gt;exec dbms_workload_capture.finish_capture;<\/p>\n<h5>\u91cd\u653e\u7aef\u51c6\u5907\u5de5\u4f5c<\/h5>\n<p>\u6211\u4eec\u8fd8\u662f\u4f7f\u7528\u524d\u9762\u5b9e\u9a8c\u7528\u8fc7\u7684OL7.1\u4e0a\u768412.1.0.2\u7684\u8fd9\u4e2a\u73af\u5883\uff0c\u4f7f\u7528test3\u8fd9\u4e2a\u6570\u636e\u5e93\u3002<\/p>\n<p>\u521b\u5efaConsolidated database replay\u76ee\u5f55\uff1a<\/p>\n<p>SQL&gt;CREATE OR REPLACE DIRECTORY con_dir AS &#8216;\/u01\/app\/oracle\/con_dir\/&#8217;;<\/p>\n<p>\u521b\u5efa\u5b58\u653etest2\u8d1f\u8f7d\u7684\u76ee\u5f55wrc_dir2\u3002\uff08wrc_dir1\u5728\u524d\u9762\u7684\u5b9e\u9a8c\u91cc\u5df2\u7ecf\u521b\u5efa\u8fc7\u4e86\u3002\uff09<\/p>\n<p>$ cd \/u01\/app\/oracle\/con_dir<\/p>\n<p>$ mkdir wrc_dir2<\/p>\n<p>SQL&gt;CREATE OR REPLACE DIRECTORY wrc_dir2 AS &#8216;\/u01\/app\/oracle\/con_dir\/wrc_dir2\/&#8217;;<\/p>\n<p>WRC_DIR1\u548cWRC_DIR2\u90fd\u662fCON_DIR\u7684\u5b50\u76ee\u5f55\u3002<\/p>\n<p>\u5728\u6570\u636e\u5e93test3\u4e0a\u521b\u5efaapp2\u7528\u6237\uff0c\u5e76\u521b\u5efa\u548c\u6355\u83b7\u7aef\u76f8\u540c\u7ed3\u6784\u7684\u8868test_table2\u3002<\/p>\n<p>\uff08app1\u7528\u6237\u548ctest_table1\u5df2\u7ecf\u5728\u4e0a\u4e2a\u5b9e\u9a8c\u4e2d\u521b\u5efa\u5728\u6570\u636e\u5e93test3\u4e0a\u4e86\uff09<\/p>\n<h5>\u5904\u7406\u8d1f\u8f7d\u5e76\u8bbe\u7f6e\u91cd\u653e\u65f6\u95f4\u8868<\/h5>\n<p>\u4f7f\u7528SYS\u7528\u6237\u6267\u884c\uff1a<\/p>\n<p>SQL&gt;exec dbms_workload_replay.set_replay_directory(&#8216;CON_DIR&#8217;);<\/p>\n<p>SQL&gt;exec dbms_workload_replay.begin_replay_schedule(&#8216;S1&#8217;); &#8212; S1\u662f\u7ed9\u65f6\u95f4\u8868\u8d77\u7684\u540d\u5b57<\/p>\n<p>SQL&gt;select dbms_workload_replay.add_capture(&#8216;WRC_DIR1&#8217;) from dual;<\/p>\n<p>SQL&gt;select dbms_workload_replay.add_capture(&#8216;WRC_DIR2&#8217;) from dual;<\/p>\n<p>SQL&gt;exec dbms_workload_replay.end_replay_schedule; &#8212; \u4fdd\u5b58\u91cd\u653e\u65f6\u95f4\u8868<\/p>\n<p>SQL&gt;exec dbms_workload_replay.initialize_consolidated_replay(&#8216;CR1&#8242;,&#8217;S1&#8217;);<\/p>\n<p>SQL&gt;exec dbms_workload_replay.prepare_consolidated_replay (synchronization =&gt; &#8216;OBJECT_ID&#8217;);<\/p>\n<p>&#8212; \u53c2\u6570synchronization\u51b3\u5b9areplay\u91cd\u653e\u8d1f\u8f7d\u7684\u65b9\u5f0f\uff0cOBJECT_ID\u4ee3\u8868replay\u91cd\u653e\u8d1f\u8f7d\u65f6\uff0c\u5bf9\u8c61\u4e0a\u7684\u64cd\u4f5c\u987a\u5e8f\uff0c\u5728\u5bf9\u8c61\u53ca\u88ab\u5f15\u7528\u7684\u5bf9\u8c61\u8303\u56f4\u5185\uff0c\u4fdd\u8bc1\u548c\u6355\u83b7\u65f6\u7684\u987a\u5e8f\u4e00\u81f4\u3002<\/p>\n<h5>\u542f\u52a8WRC\u5ba2\u6237\u7aef<\/h5>\n<p>\u56e0\u4e3a\u662f2\u4e2a\u4e0d\u540c\u7684\u8d1f\u8f7d\uff0c\u6240\u4ee5\u9700\u8981\u542f\u52a8\u81f3\u5c112\u4e2aWRC\u5ba2\u6237\u7aef<\/p>\n<p>$ wrc system\/welcome1 mode=replay replaydir=\/u01\/app\/oracle\/con_dir &amp;<\/p>\n<p>$ wrc system\/welcome1 mode=replay replaydir=\/u01\/app\/oracle\/con_dir &amp;<\/p>\n<h5>\u542f\u52a8\u91cd\u653e<\/h5>\n<p>\u7528SYS\u7528\u6237\u6267\u884c\uff1a<\/p>\n<p>SQL&gt;exec dbms_workload_replay.start_consolidated_replay;<\/p>\n<p>\u5b8c\u6210\u91cd\u653e\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u5728\u6570\u636e\u5e93test3\u4e2dapp1\u548capp2\u4e24\u4e2a\u7528\u6237\u4e0b\u7684test_table1\u548ctest_table2\u8868\u4e2d\u90fd\u88ab\u63d2\u5165\u4e8610000\u6761\u8bb0\u5f55\uff0c\u8bc1\u660e\u8d1f\u8f7d\u88ab\u6b63\u786e\u5730\u91cd\u653e\u4e86\u3002<\/p>\n<h4>Scale-Up\u573a\u666f<\/h4>\n<p>\u6709\u7684\u65f6\u5019\uff0c\u6211\u4eec\u60f3\u77e5\u9053\u672a\u6765\u4e1a\u52a1\u91cf\u589e\u957f\u4e86\uff0c\u6570\u636e\u5e93\u662f\u5426\u80fd\u627f\u53d7\u7684\u4e86\uff0c\u6bd4\u5982\u6a21\u62df\u6d4b\u8bd5\u672a\u6765\u4e1a\u52a1\u589e\u52a0\u4e00\u500d\u7684\u60c5\u51b5\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Consolidated Database Replay\u3002\u8fd9\u6837\u4f7f\u7528\u7684\u6700\u7b80\u5355\u65b9\u5f0f\u5c31\u662f\u4e00\u4efd\u6355\u83b7\uff0c\u590d\u5236\u591a\u4efd\uff0c\u540c\u65f6replay\u3002<\/p>\n<p>\u6bd4\u5982\u4e0a\u9762\u7684\u5b9e\u9a8c\uff0c\u4ecetest1\u5e93\u4e0a\u6355\u83b7\u7684\u8d1f\u8f7d\uff0c\u6211\u4eec\u53ef\u4ee5\u590d\u52362\u4efd\uff0c\u5206\u522b\u653e\u5728WRC_DIR1\u548cWRC_DIR2\u4e2d\uff0c\u5176\u4ed6\u6b65\u9aa4\u5b8c\u5168\u4e00\u6837\uff0c\u5f53\u6211\u4eec\u91cd\u653e\u65f6\uff0c\u5c31\u662f\u6267\u884c\u4e86\u53cc\u4efd\u7684test1\u4e0a\u6355\u83b7\u7684\u8d1f\u8f7d\u3002<\/p>\n<p>\u5b9e\u9645\u6548\u679c\u5c31\u662f\uff0capp1\u7528\u6237\u4e0b\u7684test_table1\u8868\u4e2d\u88ab\u63d2\u5165\u4e8620000\u6761\u8bb0\u5f55\u3002<\/p>\n<p>\u5f53\u7136\uff0cScale-Up\u5e76\u4e0d\u53ea\u662f\u8fd9\u4e48\u7b80\u5355\uff0c\u76f8\u5e94\u7684\u8fd8\u6709Time Shifting\uff0c\u5c31\u662f\u901a\u8fc7\u8c03\u6574\u65f6\u95f4\uff0c\u8ba9\u591a\u4e2a\u8d1f\u8f7d\u7684\u9ad8\u5cf0\u91cd\u5408\u5230\u4e00\u8d77\uff0c\u8fd8\u6709Workload Folding\uff0c\u5c31\u662f\u5c06\u4e00\u4e2a\u8d1f\u8f7d\uff0c\u5206\u6210\u4e0d\u540c\u7684\u65f6\u95f4\u6bb5\uff0c\u7136\u540e\u5c06\u4e0d\u540c\u65f6\u95f4\u6bb5\u7684\u8d1f\u8f7d\u5e76\u884c\u6267\u884c\u3002\u7bc7\u5e45\u6709\u9650\uff0c\u7559\u5f85\u5927\u5bb6\u81ea\u5df1\u7814\u7a76\u4e86\u3002<\/p>\n<h3>\u5e38\u89c1\u95ee\u9898\uff1a<\/h3>\n<p>\u5982\u679c\u51fa\u73b0\u6ca1\u6709\u4efb\u4f55\u62a5\u9519\uff0c\u4f46\u662f\u91cd\u653e\u7aef\u4e0d\u91cd\u653e\u8d1f\u8f7d\u7684\u60c5\u51b5\uff0c\u53ef\u80fd\u662fWRC\u5ba2\u6237\u7aef\u6709\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u5728\u91cd\u653e\u7aef\uff0c\u91cd\u65b0\u7f16\u8bd1WRC\u5ba2\u6237\u7aef\uff1a<\/p>\n<p>$ cd $ORACLE_HOME\/rdbms\/lib<\/p>\n<p>$ make -f ins_rdbms.mk iwrc<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb \u5728\u6570\u636e\u5e93\u7684\u8fc1\u79fb\u548c\u5347\u7ea7\u573a\u666f\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e00\u4e2a\u95ee\u9898\uff1a\u5728\u505a\u538b\u529b\u6d4b\u8bd5\u65f6\uff0c\u5982\u4f55\u6a21\u62df\u771f\u5b9e\u7684\u4e1a\u52a1\u538b\u529b\uff0c\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u6bd4\u5982\uff1a\u5e94\u7528\u65b9\u5f00\u53d1\u6a21\u62df\u7a0b\u5e8f\u6216\u8005\u4f7f\u7528\u538b\u529b&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/07\/182\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":181,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[6],"tags":[9],"class_list":["post-182","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oracle","tag-oracle"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"http:\/\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1407_DatabaseRep1.png","jetpack_shortlink":"https:\/\/wp.me\/p8gSFq-2W","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":470,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/22\/470\/","url_meta":{"origin":182,"position":0},"title":"\u6df7\u5408\u5217\u538b\u7f29\u548cOracle ZFS\u5b58\u50a8\u4e00\u4f53\u673a","author":"raobing","date":"2017-01-22","format":"aside","excerpt":"\u00a0 \u6df7\u5408\u5217\u538b\u7f29\uff08HCC\uff09\u7b80\u4ecb \u6df7\u5408\u5217\u538b\u7f29\uff08HCC\uff09\u6700\u65e9\u662fOracle Exadata\u7684\u72ec\u7279\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/clip_image012_thumb-2.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/clip_image012_thumb-2.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/clip_image012_thumb-2.jpg?resize=525%2C300 1.5x"},"classes":[]},{"id":16123,"url":"http:\/\/www.rao-bing.cn\/index.php\/2020\/06\/23\/16123\/","url_meta":{"origin":182,"position":1},"title":"\u795e\u821f\u901a\u7528\u6570\u636e\u5e93\u53cc\u673a\u5207\u6362\u73af\u5883\u642d\u5efa","author":"raobing","date":"2020-06-23","format":"aside","excerpt":"\u795e\u821f\u901a\u7528\u7684\u53cc\u673a\u5207\u6362\u73af\u5883\u539f\u7406\u793a\u610f\u56fe\uff1a \u795e\u901a\u6570\u636e\u5e93\u7684\u53cc\u673a\u70ed\u5907\u539f\u7406\uff0c\u4eceOracle DBA\u7684\u89d2\u5ea6\uff0c\u5176\u5b9e\u4e0d\u96be\u2026","rel":"","context":"\u5728\u201c\u53bbO\u201d\u4e2d","block_context":{"text":"\u53bbO","link":"http:\/\/www.rao-bing.cn\/index.php\/tag\/de-oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2020\/06\/lio_thumb.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2020\/06\/lio_thumb.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2020\/06\/lio_thumb.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2020\/06\/lio_thumb.png?resize=700%2C400 2x"},"classes":[]},{"id":518,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/22\/518\/","url_meta":{"origin":182,"position":2},"title":"Oracle Database 12c Data Redaction","author":"raobing","date":"2017-01-22","format":"aside","excerpt":"\u00a0 \u4ec0\u4e48\u662fData Redaction Data Redaction\u662fOracle Dat\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/clip_image034_thumb-1.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/clip_image034_thumb-1.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/clip_image034_thumb-1.jpg?resize=525%2C300 1.5x"},"classes":[]},{"id":136,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/07\/136\/","url_meta":{"origin":182,"position":3},"title":"\u4f7f\u7528\u6280\u672f\u624b\u6bb5\u9650\u5236DBA\u7684\u5371\u9669\u64cd\u4f5c","author":"raobing","date":"2017-01-07","format":"aside","excerpt":"\u6982\u8ff0 \u4f17\u6240\u5468\u77e5\uff0c\u5728\u4e1a\u52a1\u9ad8\u5cf0\u671f\uff0c\u67d0\u4e9b\u9488\u5bf9Oracle\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u5177\u6709\u5f88\u9ad8\u7684\u98ce\u9669\uff0c\u6bd4\u5982\u4fee\u6539\u8868\u7ed3\u6784\u3001\u4fee\u6539\u5b9e\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010717_1123_1.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":220,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/08\/220\/","url_meta":{"origin":182,"position":4},"title":"\u5229\u7528XAG\u5728RAC\u73af\u5883\u4e0b\u5b9e\u73b0GoldenGate\u81ea\u52a8Failover","author":"raobing","date":"2017-01-08","format":"aside","excerpt":"\u6982\u8ff0 \u5728RAC\u73af\u5883\u4e0b\u914d\u7f6eOGG\uff0c\u8981\u60f3\u5b9e\u73b0RAC\u8282\u70b9\u6545\u969c\u65f6\uff0cOGG\u80fd\u81ea\u52a8\u7684failover\u5230\u6b63\u5e38\u8282\u70b9\uff0c\u2026","rel":"","context":"\u5728\u201cGoldenGate\u201d\u4e2d","block_context":{"text":"GoldenGate","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/ogg\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010817_0958_XAGRACG2.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010817_0958_XAGRACG2.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010817_0958_XAGRACG2.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/010817_0958_XAGRACG2.png?resize=700%2C400 2x"},"classes":[]},{"id":480,"url":"http:\/\/www.rao-bing.cn\/index.php\/2017\/01\/22\/480\/","url_meta":{"origin":182,"position":5},"title":"\u901a\u8fc7RDS\u5907\u4efd\uff1aOracle Secure Backup\u7b80\u4ecb","author":"raobing","date":"2017-01-22","format":"aside","excerpt":"\u00a0 \u80cc\u666f \u6700\u65e9\u542c\u8bf4\u8fd9\u4e2a\u540d\u5b57\u662f\u5728\u51e0\u5e74\u524d\u5b9e\u65bd\u7b2c\u4e00\u53f0EXADATA\u7684\u65f6\u5019\uff0c\u5f53\u65f6\u53ea\u662f\u5728\u6295\u6807\u6587\u4ef6\u91cc\u8ba4\u2026","rel":"","context":"\u5728\u201cOracle\u201d\u4e2d","block_context":{"text":"Oracle","link":"http:\/\/www.rao-bing.cn\/index.php\/category\/oracle\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.rao-bing.cn\/wp-content\/uploads\/2017\/01\/Oracle-Security-Backup.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/comments?post=182"}],"version-history":[{"count":2,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":184,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/posts\/182\/revisions\/184"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/media\/181"}],"wp:attachment":[{"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/media?parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/categories?post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.rao-bing.cn\/index.php\/wp-json\/wp\/v2\/tags?post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}