Skip to content

Commit 7f1eef9

Browse files
authored
Add files via upload
1 parent 476d169 commit 7f1eef9

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
-- how to add capture filters
2+
3+
-- example 1 for inclusion
4+
5+
-- Add filters
6+
-- The usage mode is determined by the default_action input to the START_CAPTURE Procedure.
7+
8+
exec DBMS_WORKLOAD_CAPTURE.ADD_FILTER (fname => 'USER_TRACK', fattribute => 'USER', fvalue => 'TRACKUSER');
9+
10+
-- check status in dba_workload_filters
11+
-- check filters_used in dba_workload_captures
12+
13+
-- start capture (see capturestart.sql) and use EXCLUDE in DEFAULT_ACTION
14+
15+
execute dbms_workload_capture.start_capture (name=>'&Replayname', dir=>'&Reaplydir', default_action=>'EXCLUDE');
16+
17+
-- No user request to the database is captured, except for the part of the workload defined by the filter.
18+
19+
-- check status in dba_workload_filters
20+
-- check filters_used in dba_workload_captures
21+
22+
23+
-- example 2 for exclusion
24+
25+
-- Add filters
26+
-- The usage mode is determined by the default_action input to the START_CAPTURE Procedure.
27+
28+
exec dbms_workload_capture.add_filter('ORACLE MANAGEMENT SERVICE (DEFAULT)', 'Program', 'OMS');
29+
exec dbms_workload_capture.add_filter('ORACLE MANAGEMENT AGENT (DEFAULT)', 'Program', 'emagent%');
30+
exec dbms_workload_capture.add_filter('U_DBSNMP', 'User', 'DBSNMP');
31+
32+
33+
-- check status in dba_workload_filters
34+
-- check filters_used dba_workload_captures
35+
36+
37+
execute dbms_workload_capture.start_capture (name=>'&Replayname', dir=>'&Reaplydir', default_action=>'INCLUDE');
38+
39+
-- All user requests to the database are captured, except for the part of the workload defined by the filters.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
-- How to use replay filters
2+
3+
-- First step: Adding new filters (see replayfilter.sql).
4+
5+
-- examples for filters
6+
7+
exec DBMS_WORKLOAD_REPLAY.add_filter('ORACLE_MANAGEMENT_SERVICE', 'PROGRAM', 'OMS');
8+
exec DBMS_WORKLOAD_REPLAY.add_filter('DBSNMP_User', 'USER', 'DBSNMP');
9+
exec DBMS_WORKLOAD_REPLAY.add_filter('ORACLE_MANAGEMENT_AGENT', 'PROGRAM', 'emagent%');
10+
exec dbms_workload_capture.add_filter('RMAN_Module', 'MODULE', 'rman%');
11+
12+
-- check dba_workload_filters, filter status is now "NEW".
13+
14+
15+
-- Second step: Creating a Replay Filter Set (see replayfilterset.sql).
16+
-- The default is INCLUDE - but to make sure ...
17+
18+
exec DBMS_WORKLOAD_REPLAY.CREATE_FILTER_SET (replay_dir => '&DIR', filter_set => 'MyReplayFilter', default_action => 'INCLUDE');
19+
20+
/* CREATE_FILTER_SET creates a replay filter set named MyReplayFilter, which will replay all captured calls except for the part of the workload defined by the replay filters. */
21+
22+
-- Initialize the replay (see replayinitialize.sql)
23+
24+
execute DBMS_WORKLOAD_REPLAY.initialize_replay(replay_name=>'&NAME', replay_dir=>'&DIR', plsql_mode=>'extended');
25+
26+
-- check dba_workload_filters: status is now "IN SET
27+
28+
-- Third step: Using a Replay Filter Set (see replayusefilterset.sql).
29+
30+
exec DBMS_WORKLOAD_REPLAY.USE_FILTER_SET (filter_set => 'MyReplayFilter');
31+
32+
-- check dba_workload_filters: status is now "IN USE"
33+
-- now proceed with replayprepare.sql, wrc starts and replaystart.sql
34+
35+
36+
37+

0 commit comments

Comments
 (0)