REAL APPLICATON TESTING
DB REPLAY
At source and target database: create a
logical directory and map it with physical directory
sql>create directory source as '/u01/home/source';
sql>create directory dest as '/u01/home/dest;
sql>create directory source as '/u01/home/source';
sql>create directory dest as '/u01/home/dest;
Now start the capture process:
sql>exec dbms_workload_capture.start_capture(name=>'prodcap',dir=>'SOURCE')
sql>exec dbms_workload_capture.start_capture(name=>'prodcap',dir=>'SOURCE')
>After starting the capture process,
apply the load.
Conn scott/tiger
Conn scott/tiger
Sql>begin
for i in 1..10000
loop
insert into t1 values (‘testing’||i);
End loop;
Commit;
End;
Sql>select * from t1 where id =1001;
(10000 rows inserted...)
(10000 rows inserted...)
Now
connect to sys and finish the capture process;
>exec
dbms_workload_capture.finish_capture;
>desc dba_workload_captures (will give capture info)
>desc dba_workload_captures (will give capture info)
>Select id, name,errors,dbname from
dba_workload_captures;
Or
>Select dbms_workload_capture.get_capture_info(‘SOURCE’) from dual;
>Select name, status from
dba_workload_captures where id =’1’;
Now at the o.s, copy the captured files to
the destination or test database
]$ cp –rv * ../dest
At dest:
>exec dbms_workload_replay.process_capture(‘DEST’);
>exec dbms_workload_replay.initialize_replay(replay_name=>'testrep',replay_dir=>'DEST');
>exec dbms_workload_replay.prepare_replay(synchronization=>true);
>exec dbms_workload_replay.initialize_replay(replay_name=>'testrep',replay_dir=>'DEST');
>exec dbms_workload_replay.prepare_replay(synchronization=>true);
Now
database is ready for replay
Before starting the replay process make
some changes for testing at test database
(eg: change some parameter values)
]$wrc
(eg: change some parameter values)
]$wrc
]$wrc –help
]$wrc mode=calibrate replaydir=/u01/home/dest
(gives recommendations)
]$ wrc system/manager mode= replay
replaydir=/u01/home/dest
(it now waits for replay process to start)
(it now waits for replay process to start)
Open a new tab, export the DEST database and start the replay
process
>exec dbms_workload_replay.start_replay;
A report will be generated, Analyze the
report.
No comments:
Post a Comment