As the Workload Capture has been explained in the first part of the post, now lets see how to proceed with the rest of the replay activity.
2. Workload processing
Workload processing or analyzer is mainly used to rectify any issues that the Capture has or to prepare for the replay that we are about to perform on the target database.
-- If an error can be prevented, the Workload Analysis report displays available preventive actions that can be implemented before attempting replay.
-- If an error cannot be corrected, the report provides a description of the error so that it can be accounted for during the replay.
Start by the below command.
java -classpath $ORACLE_HOME/jdbc/lib/ojdbc7.jar:$ORACLE_HOME/rdbms/jlib/dbrparser.jar:$ORACLE_HOME/rdbms/jlib/dbranalyzer.jar: oracle.dbreplay.workload.checker.CaptureChecker /home/oracle/RAT_workload jdbc:oracle:thin:@192.168.56.131:1521:susedb12
or if you would like to skip analyzer and just import the AWR data use the below
select DBMS_WORKLOAD_CAPTURE.IMPORT_AWR (capture_id => 1, staging_schema => 'opensuse') FROM DUAL; -- to import exported AWR data from source.
3. Put the database in a state of readiness for replaying the workload and prepare for the replay
4. Start the clients
A complete report of the replay can be obtained by running the following query
2. Workload processing
Workload processing or analyzer is mainly used to rectify any issues that the Capture has or to prepare for the replay that we are about to perform on the target database.
-- If an error can be prevented, the Workload Analysis report displays available preventive actions that can be implemented before attempting replay.
-- If an error cannot be corrected, the report provides a description of the error so that it can be accounted for during the replay.
-- An instance identical to the instance used for the capture should exist - by identical, it should be logically the same. You should also consider setting the system time on the replay machine to be the same as that prior to the capture being run on the original instance to ensure that time sensitive operations (operations that depend on sysdate, etc) replay succeed accurately without issues.
-- So in our case, SH schema and it's objects should be available in the target database with its relevant data.
-- So in our case, SH schema and it's objects should be available in the target database with its relevant data.
Prerequisites
- Java runtime environment (JRE) version 1.5 or above should be present along with ojdbcNN.jar file located in the $ORACLE_HOME/jdbc/lib/ directory -- NN represents the version number
- EXECUTE privileges for the DBMS_WORKLOAD_CAPTURE package
- SELECT_CATALOG role on the target database (to user who performs Replay).
- Workload directory should also contain exported AWR data for the workload capture. -- this is explained in part 1, step 6.
Step 1: Analyze and import the AWR collected from source
Workload Analyzer is composed of two JAR files dbranalyzer.jar & dbrparser.jar located in the $ORACLE_HOME/rdbms/jlib/Start by the below command.
java -classpath $ORACLE_HOME/jdbc/lib/ojdbc7.jar:$ORACLE_HOME/rdbms/jlib/dbrparser.jar:$ORACLE_HOME/rdbms/jlib/dbranalyzer.jar: oracle.dbreplay.workload.checker.CaptureChecker /home/oracle/RAT_workload jdbc:oracle:thin:@192.168.56.131:1521:susedb12
or if you would like to skip analyzer and just import the AWR data use the below
select DBMS_WORKLOAD_CAPTURE.IMPORT_AWR (capture_id => 1, staging_schema => 'opensuse') FROM DUAL; -- to import exported AWR data from source.
Step 2: Preparing for the Replay
1. Preprocess the Workload directory
-- using DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE procedure
2. Find the number of client processes required to start the Replay process
-- wrc utility will be used to find the processes required
3. Put the database in a state of readiness for replaying the workload and prepare for the replay
-- DBMS_WORKLOAD_REPLAY.INITIALIZE_REPLAY and DBMS_WORKLOAD_REPLAY.PREPARE_REPLAY procedures will be used
4. Start the clients
-- wrc utility will be used to start the client
See the implementation section for the commands in action.
3. Workload Replay
Once all the preparations are complete, we can start the Replay on the target database.
-- DBMS_WORKLOAD_REPLAY.START_REPLAY procedure will be used to start the replay.
-- dba_workload_replays view can be used to check the status of the replay.
4. Analysis and reporting
select dbms_workload_replay.report(21,'TEXT') from dual;
Now lets see the practical implementation and later a small note on connection mapping
Practicals starts here
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | oracle@opensuse:~/RAT_workload> oracle@opensuse:~/RAT_workload> pwd /home/oracle/RAT_workload oracle@opensuse:~/RAT_workload> ls -lrt total 892 drwxr-xr-x 2 oracle oinstall 175 Feb 19 10:23 cap drwxr-xr-x 3 oracle oinstall 19 Feb 19 10:23 capfiles -rw-r--r-- 1 oracle oinstall 912327 Feb 19 10:23 rat_capture1.html oracle@opensuse:~/RAT_workload> echo $ORACLE_HOME /u01/app/oracle/product/12.1/dbhome oracle@opensuse:~/RAT_workload> echo $PATH /home/oracle/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/u01/app/oracle/product/12.1/dbhome/bin:/u01/app/oracle/product/12.1/oggcore_1:/u01/app/oracle/product/12.1/dbhome/bin:/u01/app/oracle/product/12.1/oggcore_1:/u01/app/oracle/product/12.1/dbhome/bin:/u01/app/oracle/product/12.1/oggcore_1 oracle@opensuse:~/RAT_workload> # Step 1 oracle@opensuse:~/RAT_workload> java -classpath $ORACLE_HOME/jdbc/lib/ojdbc7.jar:$ORACLE_HOME/rdbms/jlib/dbrparser.jar:$ORACLE_HOME/rdbms/jlib/dbranalyzer.jar: oracle.dbreplay.workload.checker.CaptureChecker /home/oracle/RAT_workload jdbc:oracle:thin:@192.168.56.131:1521:susedb12 Enter database username: opensuse Enter password: Importing AWR data from directory '/home/oracle/RAT_workload' Capture ID: 61 AWR dbid: 1392077117 Snapshots range: 50 -> 51 AWR import is done! Analysis done! oracle@opensuse:~/RAT_workload> ls -lrt total 900 drwxr-xr-x 3 oracle oinstall 19 Feb 19 10:23 capfiles -rw-r--r-- 1 oracle oinstall 912327 Feb 19 10:23 rat_capture1.html drwxr-xr-x 2 oracle oinstall 195 Feb 19 10:26 cap -rw-r--r-- 1 oracle oinstall 1148 Feb 19 10:27 wcr_cap_analysis.xml -rw-r--r-- 1 oracle oinstall 3881 Feb 19 10:27 wcr_cap_analysis.html oracle@opensuse:~/RAT_workload> sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Fri Feb 19 10:41:30 2016 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> -- Step 2 (1) SQL> -- Create directory object for further activities SQL> create or replace directory RAT_WORKLOAD as '/home/oracle/RAT_workload/'; Directory created. SQL> exec DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE (capture_dir => 'RAT_WORKLOAD'); PL/SQL procedure successfully completed. SQL> ! oracle@opensuse:~/RAT_workload> ls -lrt total 900 drwxr-xr-x 3 oracle oinstall 19 Feb 19 10:23 capfiles -rw-r--r-- 1 oracle oinstall 912327 Feb 19 10:23 rat_capture1.html drwxr-xr-x 2 oracle oinstall 195 Feb 19 10:26 cap -rw-r--r-- 1 oracle oinstall 1148 Feb 19 10:27 wcr_cap_analysis.xml -rw-r--r-- 1 oracle oinstall 3881 Feb 19 10:27 wcr_cap_analysis.html drwxr-xr-x 2 oracle oinstall 268 Feb 19 10:52 pp12.1.0.2.0 oracle@opensuse:~/RAT_workload> # A new directory pp12.1.0.2.0 has been created containing info oracle@opensuse:~/RAT_workload> # Step 2 (2) oracle@opensuse:~/RAT_workload> wrc replaydir=/home/oracle/RAT_workload mode=calibrate Workload Replay Client: Release 12.1.0.2.0 - Production on Fri Feb 19 22:14:27 2016 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Report for Workload in: /home/oracle/RAT_workload ----------------------- Recommendation: Consider using at least 1 clients divided among 1 CPU(s) You will need at least 150 MB of memory per client process. If your machine(s) cannot match that number, consider using more clients. Workload Characteristics: - max concurrency: 40 sessions - total number of sessions: 57 Assumptions: - 1 client process per 50 concurrent sessions - 4 client processes per CPU - 256 KB of memory cache per concurrent session - think time scale = 100 - connect time scale = 100 - synchronization = TRUE oracle@opensuse:~/RAT_workload> exit exit SQL> -- Step 2 (3) SQL> execute DBMS_WORKLOAD_REPLAY.INITIALIZE_REPLAY('test_replay_1', 'RAT_WORKLOAD'); PL/SQL procedure successfully completed. SQL> execute DBMS_WORKLOAD_REPLAY.PREPARE_REPLAY(SYNCHRONIZATION => 'OBJECT_ID'); PL/SQL procedure successfully completed. SQL> ! oracle@opensuse:~/RAT_workload> # Step 2 (4) oracle@opensuse:~/RAT_workload> # Starting 1 client process here. If you would like to start more, do so by starting using another session oracle@opensuse:~/RAT_workload> # This session will be used to monitor until Replay completes. oracle@opensuse:~/RAT_workload> wrc replaydir=/home/oracle/RAT_workload Workload Replay Client: Release 12.1.0.2.0 - Production on Fri Feb 19 22:19:29 2016 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Username:opensuse Password: Wait for the replay to start (22:19:44) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | oracle@opensuse:~/RAT_workload> # Step 3. Workload Replay oracle@opensuse:~/RAT_workload> echo $ORACLE_HOME /u01/app/oracle/product/12.1/dbhome oracle@opensuse:~/RAT_workload> echo $ORACLE_SID susedb12 oracle@opensuse:~/RAT_workload> sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Fri Feb 19 22:23:00 2016 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SQL> execute DBMS_WORKLOAD_REPLAY.START_REPLAY; PL/SQL procedure successfully completed. SQL> |
1 2 3 4 5 6 7 8 9 10 11 12 13 | oracle@opensuse:~/RAT_workload> wrc replaydir=/home/oracle/RAT_workload Workload Replay Client: Release 12.1.0.2.0 - Production on Fri Feb 19 22:19:29 2016 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Username:opensuse Password: Wait for the replay to start (22:19:44) Replay client 1 started (22:28:50) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | SQL> select id, name,status from dba_workload_replays; ID NAME STATUS ---------- ------------------------------ ---------------------------------------- 1 test_replay_1 COMPLETED 21 test_replay_1 IN PROGRESS 11 test_replay_2 COMPLETED SQL> select id, name,status from dba_workload_replays; ID NAME STATUS ---------- ------------------------------ ---------------------------------------- 1 test_replay_1 COMPLETED 21 test_replay_1 COMPLETED 11 test_replay_2 COMPLETED SQL> -- I have already run the tests for other combinations and hence the result. SQL> -- We are now interested in ID 21 which is now completed. SQL> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | oracle@opensuse:~/RAT_workload> wrc replaydir=/home/oracle/RAT_workload Workload Replay Client: Release 12.1.0.2.0 - Production on Fri Feb 19 22:19:29 2016 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. Username:opensuse Password: Wait for the replay to start (22:19:44) Replay client 1 started (22:28:50) Replay client 1 finished (22:40:36) oracle@opensuse:~/RAT_workload> # We can see the Replay status as finished which took oracle@opensuse:~/RAT_workload> # only 12 minutes against our capture of 39 min 56 sec with 20 minutes regression oracle@opensuse:~/RAT_workload> exit exit SQL> -- Step 4. Analysis and Reporting SQL> set lines 300 SQL> set pagesize 0 long 30000000 longchunksize 1000 SQL> select dbms_workload_replay.report(21,'TEXT') from dual; DB Replay Report for test_replay_1 --------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------- | DB Name | DB Id | Release | RAC | Replay Name | Replay Status | ---------------------------------------------------------------------------- | SUSEDB12 | 2345262617 | 12.1.0.2.0 | NO | test_replay_1 | COMPLETED | ---------------------------------------------------------------------------- Replay Information ---------------------------------------------------------------------------------- | Information | Replay | Capture | ---------------------------------------------------------------------------------- | Name | test_replay_1 | RAT_CAPTURE | ---------------------------------------------------------------------------------- | Status | COMPLETED | COMPLETED | ---------------------------------------------------------------------------------- | Database Name | SUSEDB12 | NONPLUG | ---------------------------------------------------------------------------------- | Database Version | 12.1.0.2.0 | 12.1.0.1.0 | ---------------------------------------------------------------------------------- | Start Time | 19-02-16 16:58:49 | 18-02-16 09:10:29 | ---------------------------------------------------------------------------------- | End Time | 19-02-16 17:07:22 | 18-02-16 09:50:25 | ---------------------------------------------------------------------------------- | Duration | 8 minutes 33 seconds | 39 minutes 56 seconds | ---------------------------------------------------------------------------------- | Directory Object | RAT_WORKLOAD | RAT_WORKLOAD | ---------------------------------------------------------------------------------- | Directory Path | /home/oracle/RAT_workload/ | /home/oracle/RAT_workload/ | ---------------------------------------------------------------------------------- | AWR DB Id | 2345262617 | | ---------------------------------------------------------------------------------- | AWR Begin Snap Id | 82 | | ---------------------------------------------------------------------------------- | AWR End Snap Id | 83 | | ---------------------------------------------------------------------------------- | Replay Schedule Name | | | ---------------------------------------------------------------------------------- Replay Options --------------------------------------------------------- | Option Name | Value | --------------------------------------------------------- | Synchronization | OBJECT_ID | --------------------------------------------------------- | Connect Time | 100% | --------------------------------------------------------- | Think Time | 100% | --------------------------------------------------------- | Think Time Auto Correct | TRUE | --------------------------------------------------------- | Number of WRC Clients | 1 (1 Completed, 0 Running ) | --------------------------------------------------------- Replay Statistics ------------------------------------------------------------------ | Statistic | Replay | Capture | ------------------------------------------------------------------ | DB Time | 4403.231 seconds | 33451.412 seconds | ------------------------------------------------------------------ | Average Active Sessions | 8.58 | 13.96 | ------------------------------------------------------------------ | User calls | 16588 | 16588 | ------------------------------------------------------------------ Replay Divergence Summary ------------------------------------------------------------------- | Divergence Type | Count | % Total | ------------------------------------------------------------------- | Session Failures During Replay | 0 | 0.00 | ------------------------------------------------------------------- | Errors No Longer Seen During Replay | 0 | 0.00 | ------------------------------------------------------------------- | New Errors Seen During Replay | 0 | 0.00 | ------------------------------------------------------------------- | Errors Mutated During Replay | 0 | 0.00 | ------------------------------------------------------------------- | DMLs with Different Number of Rows Modified | 0 | 0.00 | ------------------------------------------------------------------- | SELECTs with Different Number of Rows Fetched | 0 | 0.00 | ------------------------------------------------------------------- --------------------------------------------------------------------------------------------------- Workload Profile Top Events ------------------------------------------------------ | Event | Event Class | % Activity | ------------------------------------------------------ | resmgr:cpu quantum | Scheduler | 77.75 | ------------------------------------------------------ | CPU + Wait for CPU | CPU | 18.22 | ------------------------------------------------------ | read by other session | User I/O | 1.48 | ------------------------------------------------------ | db file parallel read | User I/O | 1.27 | ------------------------------------------------------ | db file sequential read | User I/O | 0.21 | ------------------------------------------------------ Top Service/Module/Action --------------------------------------------------------------------------------------------------- | Service Name | Module Name | % Activity | Action Drilldown | --------------------------------------------------------------------------------------------------- | SYS$USERS | SalesRollupByMonth | 24.36 | -------------------------------- | | | | | | Action Name | % Activity | | | | | | -------------------------------- | | | | | | UNNAMED | 24.36 | | | | | | -------------------------------- | --------------------------------------------------------------------------------------------------- | SYS$USERS | SalesCubeByMonth | 21.82 | -------------------------------- | | | | | | Action Name | % Activity | | | | | | -------------------------------- | | | | | | UNNAMED | 21.82 | | | | | | -------------------------------- | --------------------------------------------------------------------------------------------------- | SYS$USERS | TopSalesWithinQuarter | 15.89 | -------------------------------- | | | | | | Action Name | % Activity | | | | | | -------------------------------- | | | | | | UNNAMED | 15.89 | | | | | | -------------------------------- | --------------------------------------------------------------------------------------------------- | SYS$USERS | SalesMovingAverage | 12.50 | -------------------------------- | | | | | | Action Name | % Activity | | | | | | -------------------------------- | | | | | | UNNAMED | 12.50 | | | | | | -------------------------------- | --------------------------------------------------------------------------------------------------- | SYS$USERS | SalesByQuarterCountry | 6.78 | -------------------------------- | | | | | | Action Name | % Activity | | | | | | -------------------------------- | | | | | | UNNAMED | 6.78 | | | | | | -------------------------------- | --------------------------------------------------------------------------------------------------- Top SQL with Top Events --------------------------------------------------------------------------------------------------- | SQL ID | Planhash | Sampled Number of | % Activity | Event Drilldown | | | | Executions | | | --------------------------------------------------------------------------------------------------- | 6vrsbutr8h1mk | 121580580 | 9 | 1.91 | ------------------------- | | | | | | | Event | % | | | | | | | | | Activity | | | | | | | ------------------------- | | | | | | | resmgr:cp | 1.91 | | | | | | | | u quantum | | | | | | | | ------------------------- | --------------------------------------------------------------------------------------------------- | 5u3nfctgbckmr | 121580580 | 7 | 1.48 | ------------------------- | | | | | | | Event | % | | | | | | | | | Activity | | | | | | | ------------------------- | | | | | | | resmgr:cp | 1.27 | | | | | | | | u quantum | | | | | | | | ------------------------- | | | | | | | CPU + | 0.21 | | | | | | | | Wait for | | | | | | | | | CPU | | | | | | | | ------------------------- | --------------------------------------------------------------------------------------------------- | av4bt2kryg5md | 121580580 | 7 | 1.48 | ------------------------- | | | | | | | Event | % | | | | | | | | | Activity | | | | | | | ------------------------- | | | | | | | resmgr:cp | 1.48 | | | | | | | | u quantum | | | | | | | | ------------------------- | --------------------------------------------------------------------------------------------------- | cw3ytzbdwd7n9 | 121580580 | 6 | 1.27 | ------------------------- | | | | | | | Event | % | | | | | | | | | Activity | | | | | | | ------------------------- | | | | | | | CPU + | 0.64 | | | | | | | | Wait for | | | | | | | | | CPU | | | | | | | | ------------------------- | | | | | | | resmgr:cp | 0.64 | | | | | | | | u quantum | | | | | | | | ------------------------- | --------------------------------------------------------------------------------------------------- | gmq00as592t0q | 1940277083 | 6 | 1.27 | ------------------------- | | | | | | | Event | % | | | | | | | | | Activity | | | | | | | ------------------------- | | | | | | | resmgr:cp | 1.27 | | | | | | | | u quantum | | | | | | | | ------------------------- | --------------------------------------------------------------------------------------------------- Top Sessions with Top Events -------------------------------------------------------------------------------------------------- | Session ID | Session Serial | Username | Program | % Activity | Event Drilldown | -------------------------------------------------------------------------------------------------- | 34 | 61837 | SH | wrc@opensuse.selv | 3.39 | ----------------- | | | | | apc.com (TNS | | | Event | % Act | | | | | | V1-V3) | | | | ivity | | | | | | | | ----------------- | | | | | | | | resmg | 2.97 | | | | | | | | | r:cpu | | | | | | | | | | quant | | | | | | | | | | um | | | | | | | | | ----------------- | | | | | | | | CPU + | 0.42 | | | | | | | | | Wait | | | | | | | | | | for | | | | | | | | | | CPU | | | | | | | | | ----------------- | -------------------------------------------------------------------------------------------------- | 49 | 32961 | SH | wrc@opensuse.selv | 2.97 | ----------------- | | | | | apc.com (TNS | | | Event | % Act | | | | | | V1-V3) | | | | ivity | | | | | | | | ----------------- | | | | | | | | resmg | 1.91 | | | | | | | | | r:cpu | | | | | | | | | | quant | | | | | | | | | | um | | | | | | | | | ----------------- | | | | | | | | CPU + | 1.06 | | | | | | | | | Wait | | | | | | | | | | for | | | | | | | | | | CPU | | | | | | | | | ----------------- | -------------------------------------------------------------------------------------------------- | 270 | 21487 | SH | wrc@opensuse.selv | 2.97 | ----------------- | | | | | apc.com (TNS | | | Event | % Act | | | | | | V1-V3) | | | | ivity | | | | | | | | ----------------- | | | | | | | | resmg | 2.75 | | | | | | | | | r:cpu | | | | | | | | | | quant | | | | | | | | | | um | | | | | | | | | ----------------- | | | | | | | | CPU + | 0.21 | | | | | | | | | Wait | | | | | | | | | | for | | | | | | | | | | CPU | | | | | | | | | ----------------- | -------------------------------------------------------------------------------------------------- | 43 | 50193 | SH | wrc@opensuse.selv | 2.75 | ----------------- | | | | | apc.com (TNS | | | Event | % Act | | | | | | V1-V3) | | | | ivity | | | | | | | | ----------------- | | | | | | | | resmg | 2.75 | | | | | | | | | r:cpu | | | | | | | | | | quant | | | | | | | | | | um | | | | | | | | | ----------------- | -------------------------------------------------------------------------------------------------- | 290 | 11101 | SH | wrc@opensuse.selv | 2.75 | ----------------- | | | | | apc.com (TNS | | | Event | % Act | | | | | | V1-V3) | | | | ivity | | | | | | | | ----------------- | | | | | | | | resmg | 2.33 | | | | | | | | | r:cpu | | | | | | | | | | quant | | | | | | | | | | um | | | | | | | | | ----------------- | | | | | | | | CPU + | 0.42 | | | | | | | | | Wait | | | | | | | | | | for | | | | | | | | | | CPU | | | | | | | | | ----------------- | -------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------- Replay Divergence Session Failures By Application -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- Error Divergence By Application -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- By SQL -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- DML Data Divergence By Application -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- By SQL -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- By Divergence magnitude -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- SELECT Data Divergence By Application -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- By Divergence magnitude -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- --------------------------------------------------------------------------------------------------- Replay Clients Alerts -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- Replay Filters -------------------------------------------------- | No data exists for this section of the report. | -------------------------------------------------- End of Report. SQL> |
You can see the report which shows we have "resmgr:cpu quantum" wait events. This is due to the Resource manager plan active in the database. You can disable the Resource manager and rerun the Replay to see the increase in performance.
Resource manager can be disabled by the below command
alter system set resource_manager_plan='' scope=both;
Connection Mapping:
What if you would like to perform the Replay activity on a RAC database? What if you would like to reroute some of the connections (DB links, etc) to other targets? Connection mapping can help you out in this case.
Connection mapping can be used as below for a RAC environment and should be done before the Replay activity is performed.
1 2 3 4 5 6 7 | BEGIN DBMS_WORKLOAD_REPLAY.REMAP_CONNECTION( connection_id => 1 ,replay_connection => '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=12r1-rac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=12r1-rac2-vip)(PORT=1521))(LOAD_BALANCE=YES)(FAILOVER=YES)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=NONPLUG)))' ); END; / |
Happy Testing!!