This section assumes a scenario where workloads from three separate production systems running different versions of Oracle Database on various operating systems are being consolidated.
This scenario uses the following assumptions:
The first workload to be consolidated is captured from the CRM system, which is running Oracle Database 10g Release 2 (release 10.2.0.4) on a Solaris server.
The second workload to be consolidated is captured from the ERP system, which is running Oracle Database 10g Release 2 (release 10.2.0.5) on a Linux server.
The third workload to be consolidated is captured from the SCM system, which is running Oracle Database 11g Release 2 (release 11.2.0.2) on a Solaris server.
The test system is set up as a multitenant container database (CDB) running Oracle Database 12c Release 1 (release 12.1.0.1).
The CDB contains three PDBs created from the CRM, ERP, and SCM systems.
Each PDB contained within the CDB is restored to the same application data state as the CRM, ERP, and SCM systems at the capture start time.
Figure 15-3 illustrates this scenario.
Figure 15-3 Scenario for Consolidating Three Workloads
To consolidate the workloads and replay the consolidated workload in this scenario:
On the test system, preprocess the individual workload captures into separate directories:
For the CRM workload:
Create a directory object:
CREATE OR REPLACE DIRECTORY crm AS '/u01/test/cap_crm';
Ensure that the captured workload from the CRM system is stored in this directory.
Preprocess the workload:
EXEC DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE ('CRM');
For the ERP workload:
Create a directory object:
CREATE OR REPLACE DIRECTORY erp AS '/u01/test/cap_erp';
Ensure that the captured workload from the ERP system is stored in this directory.
Preprocess the workload:
EXEC DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE ('ERP');
For the SCM workload:
Create a directory object:
CREATE OR REPLACE DIRECTORY scm AS '/u01/test/cap_scm';
Ensure that the captured workload from the SCM system is stored in this directory.
Preprocess the workload:
EXEC DBMS_WORKLOAD_REPLAY.PROCESS_CAPTURE ('SCM');
Create a root directory to store the preprocessed workloads:
mkdir '/u01/test/cons_dir'; CREATE OR REPLACE DIRECTORY cons_workload AS '/u01/test/cons_dir';
Copy each preprocessed workload directory into the root directory:
cp -r /u01/test/cap_crm /u01/test/cons_dir cp -r /u01/test/cap_erp /u01/test/cons_dir cp -r /u01/test/cap_scm /u01/test/cons_dir
For each workload, create a directory object using the new operating system directory path:
CREATE OR REPLACE DIRECTORY crm AS '/u01/test/cons_dir/cap_crm'; CREATE OR REPLACE DIRECTORY erp AS '/u01/test/cons_dir/cap_erp'; CREATE OR REPLACE DIRECTORY scm AS '/u01/test/cons_dir/cap_scm';
Set the replay directory to the root directory previously created in Step 2:
EXEC DBMS_WORKLOAD_REPLAY.SET_REPLAY_DIRECTORY ('CONS_WORKLOAD');
Create a replay schedule and add the workload captures:
EXEC DBMS_WORKLOAD_REPLAY.BEGIN_REPLAY_SCHEDULE ('CONS_SCHEDULE'); SELECT DBMS_WORKLOAD_REPLAY.ADD_CAPTURE ('CRM') FROM dual; SELECT DBMS_WORKLOAD_REPLAY.ADD_CAPTURE ('ERP') FROM dual; SELECT DBMS_WORKLOAD_REPLAY.ADD_CAPTURE ('SCM') FROM dual; EXEC DBMS_WORKLOAD_REPLAY.END_REPLAY_SCHEDULE;
Initialize the consolidated replay:
EXEC DBMS_WORKLOAD_REPLAY.INITIALIZE_CONSOLIDATED_REPLAY ('CONS_REPLAY', 'CONS_SCHEDULE');
Remap connections:
Query the DBA_WORKLOAD_CONNECTION_MAP
view for the connection mapping information:
SELECT schedule_cap_id, conn_id, capture_conn, replay_conn FROM dba_workload_connection_map;
Remap the connections:
EXEC DBMS_WORKLOAD_REPLAY.REMAP_CONNECTION (schedule_cap_id => 1, conn_id => 1, replay_connection => 'CRM'); EXEC DBMS_WORKLOAD_REPLAY.REMAP_CONNECTION (schedule_cap_id => 2, conn_id => 1, replay_connection => 'ERP'); EXEC DBMS_WORKLOAD_REPLAY.REMAP_CONNECTION (schedule_cap_id => 3, conn_id => 1, replay_connection => 'SCM');
The replay_connection
parameter represents the services that are defined on the test system.
Verify the connection remappings:
SELECT schedule_cap_id, conn_id, capture_conn, replay_conn FROM dba_workload_connection_map;
Prepare the consolidated replay:
EXEC DBMS_WORKLOAD_REPLAY.PREPARE_CONSOLIDATED_REPLAY ( synchronization => 'OBJECT_ID');
Start replay clients:
Estimate the number of replay clients that are required:
wrc mode=calibrate replaydir=/u01/test/cons_dir/cap_crm wrc mode=calibrate replaydir=/u01/test/cons_dir/cap_erp wrc mode=calibrate replaydir=/u01/test/cons_dir/cap_scm
Add the output to determine the number of replay clients required.
You will need to start at least one replay client per workload capture contained in the consolidated workload.
Start the required number of replay clients by repeating this command:
wrc username/password mode=replay replaydir=/u01/test/cons_dir
The replaydir
parameter is set to the root directory in which the workload captures are stored.
Start the consolidated replay:
EXEC DBMS_WORKLOAD_REPLAY.START_CONSOLIDATED_REPLAY;
Oracle Database Administrator's Guide for information about configuring a CDB
Oracle Database Administrator's Guide for information about creating PDBs