Skip to content

Commit babe8ed

Browse files
Merge pull request #1167 from oracle-devrel/uschwinn-patch-22
Uschwinn patch 22
2 parents 476d169 + a03efef commit babe8ed

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-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 of 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=>'&Name', dir=>'&Dir', default_action=>'EXCLUDE');
16+
17+
-- EXCLUDE: 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 of START_CAPTURE procedure.
27+
28+
exec dbms_workload_capture.add_filter('ORACLE_MANAGEMENT_SERVICE', 'Program', 'OMS');
29+
exec dbms_workload_capture.add_filter('ORACLE_MANAGEMENT_AGENT', '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 in dba_workload_captures
35+
36+
37+
execute dbms_workload_capture.start_capture (name=>'&Name', dir=>'&Dir', default_action=>'INCLUDE');
38+
39+
-- INCLUDE: All user requests to the database are captured, except for the part of the workload defined by the filters.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
-- How to use replay filters
2+
3+
-- First step: Adding new filters (see replayfilter.sql).
4+
5+
-- Adding filters
6+
exec DBMS_WORKLOAD_REPLAY.add_filter('ORACLE_MANAGEMENT_SERVICE', 'PROGRAM', 'OMS');
7+
exec DBMS_WORKLOAD_REPLAY.add_filter('DBSNMP_USER', 'USER', 'DBSNMP');
8+
exec DBMS_WORKLOAD_REPLAY.add_filter('ORACLE_MANAGEMENT_AGENT', 'PROGRAM', 'emagent%');
9+
exec DBMS_WORKLOAD_REPLAY.add_filter('RMAN_MODULE', 'MODULE', 'rman%');
10+
11+
-- check dba_workload_filters, filter status is now "NEW".
12+
13+
14+
-- Second step: Creating a Replay Filter Set (see replayfilterset.sql).
15+
exec DBMS_WORKLOAD_REPLAY.CREATE_FILTER_SET (replay_dir => '&DIR', filter_set => 'MyReplayFilter', default_action => 'INCLUDE');
16+
17+
-- INCLUDE: 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.
18+
-- See capturefilterusage.sql for EXCLUDE example.
19+
20+
-- Initialize replay (see replayinitialize.sql)
21+
22+
execute DBMS_WORKLOAD_REPLAY.initialize_replay(replay_name=>'&NAME', replay_dir=>'&DIR', plsql_mode=>'extended');
23+
24+
-- check dba_workload_filters: status is now "IN SET
25+
26+
-- Third step: Using a Replay Filter Set (see replayusefilterset.sql).
27+
exec DBMS_WORKLOAD_REPLAY.USE_FILTER_SET (filter_set => 'MyReplayFilter');
28+
29+
-- check dba_workload_filters: status is now "IN USE"
30+
31+
-- now proceed with replayprepare.sql, wrc starts and replaystart.sql
32+
33+
34+
35+

0 commit comments

Comments
 (0)