Scale_up_multiplier settings in db replay in oracle do not take effect

Source: Internet
Author: User
Tags commit create directory create index prepare reserved sessions

Db replay setting scale_up_multiplier does not take effect

Set scale_up_multiplier:

BEGIN
DBMS_WORKLOAD_REPLAY.PREPARE_REPLAY (scale_up_multiplier => 10 );
END;

However, after setting, check DBA_WORKLOAD_REPLAYS.SCALE_UP_MULTIPLIER and find that this value is always 1.

This is because scale_up_multiplier does not support object id-based synchronization. When the value of synchronization is object_id, scale_up_multiplier is hard code 1 in the code (BUG 9774435 ).

The synchronization parameter defaults to true, which is earlier than 11g (as if it was earlier than 11.2.0.3). If the default value is true, it refers to SCN, which is later than 11g, if the default value is true, it means object_id.

Therefore, what we mentioned in earlier documents

SQL> exec dbms_workload_replay.prepare_replay (synchronization => TRUE ,....
In this case, the true value is SCN. Therefore, according to the instructions in earlier documents, it is acceptable to enlarge scale_up_multiplier after prepare is executed on earlier versions of data, can be enlarged to a specified multiple.

However, in my 11.2.0.4.5, if synchronization => TRUE is set according to the instructions in earlier documents, scale_up_multiplier settings will not take effect.

Solution: explicitly set synchronization => 'scn'

BEGIN
DBMS_WORKLOAD_REPLAY.PREPARE_REPLAY (synchronization => 'scn ', scale_up_multiplier => 10 );
END;

Supplement the usage of db repaly

Database Replay mainly uses two packages: DBMS_WORKLOAD_CAPTURE and DBMS_WORKLOAD_REPLAY, which are divided into four steps:
1. Capture the load of the product database.
2. Load information captured by preprocessing.
3. Replay the database load.
4. Create a report and analyze the results. [@-@] **********
* Source Database
**********
-- Create a directory for storing load information.
SQL> create directory relay_source as 'd: tempsource ';
The directory has been created.

-- Create an information filter. In this example, only all operations of SCOTT are captured.
SQL> exec dbms_workload_capture.add_filter (fname => 'User _ scott ', fattribute => 'user', fvalue => 'Scott ');
The PL/SQL process is successfully completed.

-- Start crawling. The time is 900 seconds.
SQL> exec dbms_workload_capture.start_capture (name => 'Scott _ 000000', dir => 'relay _ source', duration => 900 );
The PL/SQL process is successfully completed.

-- Operations performed by SCOTT in another window
SQL> conn scott/tiger
Connected.
SQL> create table temp1 as select * from dba_objects;
The table has been created.
SQL> insert into temp1 select * from temp1;
You have created 68366 rows.
SQL> insert into temp1 select * from temp1;
You have created 136732 rows.
SQL> commit;
Submitted.
SQL> insert into temp1 select * from temp1;
You have created 273464 rows.
SQL> insert into temp1 select * from temp1;
You have created 546928 rows.
SQL> commit;
Submitted.
SQL> insert into temp1 select * from temp1;
You have created 1093856 rows.
SQL> commit;
Submitted.
SQL> create index idx1 on temp1 (object_id );
The index has been created.
......
SQL> insert into temp1 select * from temp1;
You have created 2187712 rows.
SQL> commit;
Submitted.
SQL> conn/as sysdba
Connected.

-- In less than 900 seconds, the system stops capturing information.
SQL> exec dbms_workload_capture.finish_capture ();
The PL/SQL process is successfully completed.

-- File generated under the Directory.
D: tempsource :-
6,222 wcr_4m4k7ws0020r0.rec
1,152 wcr_4m4k7ws0000000000rec
Wcr_4m4k8pc0023v8.rec
1,372 wcr_4m4k9r80021m8.rec
49,620 wcr_cr.html
23,370 wcr_cr.text
181 wcr_fcapture.wmd
120 wcr_scapture.wmd

************
* Target database
************
-- Create a directory and copy the above files from the original directory.
SQL> create directory relay_target as 'd: temptarget ';
The directory has been created.

-- Preprocessing these files.
SQL> exec dbms_workload_replay.process_capture (capture_dir => 'relay _ target ');
The PL/SQL process is successfully completed.

-- Generate 5 new files after preprocessing
D: temptarget :-
12,288 WCR_CONN_DATA.EXTB
142 wcr_login.pp
35 wcr_process.wmd
12,288 WCR_SCN_ORDER.EXTB
12,288 WCR_SEQ_DATA.EXTB

-- The wrc calibrate mode can be used for verification.
D: temptarget> wrc mode = calibrate replaydir =.
Workload Replay Client: Release 11.1.0.6.0-Production on Wednesday 135
0 2009
Copyright (c) 1982,200 7, Oracle. All rights reserved.

Report for Workload in :.
-----------------------
Recommendation:
Consider using at least 1 clients divided among 1 CPU (s ).
Workload Characteristics:
-Max concurrency: 1 sessions
-Total number of sessions: 2
Assumptions:
-1 client process per 50 concurrent sessions
-4 client process per CPU
-Think time scaling = 100
-Connect time scaling = 100
-Synchronization = TRUE

-- Execute the following two processes to prepare for replay.
SQL> exec dbms_workload_replay.initialize_replay (replay_name => 'Scott _ 000000', replay_dir => 'relay _ target ');
The PL/SQL process is successfully completed.
SQL> exec dbms_workload_replay.prepare_replay (synchronization => true );
The PL/SQL process is successfully completed.

-- Start wrc in replay mode, and the screen will be in the wait status.
D: temptarget> wrc system/oracle mode = replay replaydir =.
Workload Replay Client: Release 11.1.0.6.0-Production on Wednesday February 11 14:03:4
4 2009
Copyright (c) 1982,200 7, Oracle. All rights reserved.

Wait for the replay to start (14:03:44)

-- Run start_replay in another window.
SQL> conn/as sysdba
Connected.
SQL> exec DBMS_WORKLOAD_REPLAY.START_REPLAY ();
The PL/SQL process is successfully completed.

-- The wrc window displays the start of replay.
Wait for the replay to start (14:03:44)
Replay started (14:04:06)

-- During the replay process, we can see different data volumes in table temp1 at different time points.
-- Note: due to environment restrictions, the source database and target database are actually the same database. Delete the table temp1 of scott before replay.
SQL> select count (*) from temp1;
COUNT (*)
----------
1093840

SQL> select count (*) from temp1;
COUNT (*)
----------
2187680

-- After replay, the wrc window is displayed.
Wait for the replay to start (14:03:44)
Replay started (14:04:06)
Replay finished (1443)

-- A report is generated after the replay, or the following script can be used to generate the report.
DECLARE
Cap_id NUMBER;
Rep_id NUMBER;
Rep_rpt CLOB;
BEGIN
Cap_id: = DBMS_WORKLOAD_REPLAY.GET_REPLAY_INFO (dir => 'relay _ target ');
/* Get the latest replay for that capture */
SELECT max (id)
INTO rep_id
FROM dba_workload_replays
WHERE capture_id = cap_id;

Rep_rpt: = DBMS_WORKLOAD_REPLAY.REPORT (replay_id => rep_id,
Format => DBMS_WORKLOAD_REPLAY.TYPE_TEXT );
END;
/

-- The following operations cannot be captured or replayed.
■ SQL * Loader direct path load of data
■ Oracle Streams
■ Data Pump Import and Export
■ Advanced replication streams
■ Non-PL/SQL-based Advanced Queuing (AQ)
■ Flashback Database and Flashback queries
■ Distributed transactions and remote describe/commit operations
■ Shared server
■ Non-SQL-based object access

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.