1 PACKAGE dbms_rat_mask AS
2
3 -----------------------------------------------------------------------------
4 -- global constant declarations --
5 -----------------------------------------------------------------------------
6
7
8 -----------------------------------------------------------------------------
9 -- procedure / function declarations --
10 -----------------------------------------------------------------------------
11
12 --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
13 --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
14 -- ----------------------------- --
15 -- MAIN PROCEDURES/FUNCTIONS --
16 -- ----------------------------- --
17 --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
18 --+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
19
20 ----------------------------- initialize_masking ---------------------------
21 -- NAME:
22 -- initialize_masking - Initialize rat Masking run
23 --
24 -- DESCRIPTION
25 -- This procedure parses the masking definition xml to extract values
26 -- of masking parameters. It also inserts those values in the catalog
27 -- tables of RAT masking.
28 --
29 -- PARAMETERS:
30 -- user_name (IN) - user executing the masking script
31 -- package_name (IN) - name of masking package
32 -- mask_definition (IN) - xml of masking definition
33 -- control_xml (IN) - control xml from masking definition
34 --
35 -- RETURNS:
36 -- NONE
37 --
38 -- EXCEPTIONS:
39 -- NONE
40 -----------------------------------------------------------------------------
41 PROCEDURE initialize_masking(
42 user_name IN VARCHAR2,
43 package_name IN VARCHAR2,
44 mask_definition IN XMLTYPE,
45 control_xml IN XMLTYPE DEFAULT NULL);
46
47
48 ------------------------------- get_rat_version ----------------------------
49 -- NAME:
50 -- get_rat_version - Return the version number of RAT masking
51 --
52 -- DESCRIPTION
53 -- This function returns the version number of RAT masking. It is used
54 -- in the main data masking script to figure which version of rat
55 -- masking it is being used with.
56 --
57 -- PARAMETERS:
58 -- NONE
59 --
60 -- RETURNS:
61 -- version as a number
62 --
63 -----------------------------------------------------------------------------
64 FUNCTION get_rat_version RETURN NUMBER;
65
66 ------------------------------ spa_extract_data -----------------------------
67 -- NAME:
68 -- spa_extract_data - SPA Extract Data
69 --
70 -- DESCRIPTION
71 -- This procedure is the plsql interface for the extract phase of rat
72 -- masking for SQL tuning sets. It makes a call out to the kernel
73 -- function which iterates over each stmt in each STS in the db and
74 -- extracts all sensitive bind values.
75 --
76 -- PARAMETERS:
77 -- script_id (IN) - id of masking script
78 --
79 -- RETURNS:
80 -- NONE
81 --
82 -----------------------------------------------------------------------------
83 PROCEDURE spa_extract_data(script_id IN NUMBER);
84
85 ------------------------------ dbr_extract_data -----------------------------
86 -- NAME:
87 -- dbr_extract_data - DB Replay Extract Data
88 --
89 -- DESCRIPTION
90 -- This procedure is the plsql interface for the extract phase of rat
91 -- masking for capture files. It makes a call out to the kernel
92 -- function which iterates over each stmt in each capture file and
93 -- extracts all sensitive bind values.
94 --
95 -- PARAMETERS:
96 -- capture_directory (IN) - directory having capture files to be masked
97 -- script_id (IN) - id of masking script
98 --
99 -- RETURNS:
100 -- NONE
101 --
102 -----------------------------------------------------------------------------
103 PROCEDURE dbr_extract_data(
104 capture_directory IN VARCHAR2,
105 script_id IN NUMBER);
106
107 ------------------------------ spa_mask_data --------------------------------
108 -- NAME:
109 -- spa_mask_data - SPA Mask Data
110 --
111 -- DESCRIPTION
112 -- This procedure is the plsql interface for the mask phase of rat
113 -- masking for SQL tuning sets. It makes a call out to the kernel
114 -- function which iterates over each stmt in each STS in the db and
115 -- replaces the values of all sensitive binds with masked values.
116 -- It also removes peeked binds present in the other_xml column of
117 -- the plan lines table.
118 --
119 -- PARAMETERS:
120 -- script_id (IN) - id of masking script
121 --
122 -- RETURNS:
123 -- NONE
124 --
125 -----------------------------------------------------------------------------
126 PROCEDURE spa_mask_data(script_id IN NUMBER);
127
128 ------------------------------ dbr_mask_data --------------------------------
129 -- NAME:
130 -- dbr_mask_data - DB Replay Mask Data
131 --
132 -- DESCRIPTION
133 -- This procedure is the plsql interface for the mask phase of rat
134 -- masking for capture files. It makes a call out to the kernel
135 -- function which iterates over each stmt in each cap file and
136 -- replaces the values of all sensitive binds with masked values.
137 -- It also removes binds in AWR.
138 --
139 -- PARAMETERS:
140 -- capture_directory (IN) - capture directory
141 -- script_id (IN) - id of masking script
142 --
143 -- RETURNS:
144 -- NONE
145 --
146 -----------------------------------------------------------------------------
147 PROCEDURE dbr_mask_data(
148 capture_directory IN VARCHAR2,
149 script_id IN NUMBER);
150
151
152 ------------------------------ awr_purge_binds ------------------------------
153 -- NAME:
154 -- awr_purge_binds - AWR Purge Binds
155 --
156 -- DESCRIPTION
157 -- This procedure runs an update stmt to delete peeked binds from the
158 -- other_xml of the AWR plans table.
159 --
160 -- PARAMETERS:
161 -- NONE
162 --
163 -- RETURNS:
164 -- NONE
165 --
166 -----------------------------------------------------------------------------
167 PROCEDURE awr_purge_binds;
168
169
170 --------------------------- remove_spa_peeked_binds -------------------------
171 -- NAME:
172 -- remove_spa_peeked_binds - Remove SPA Peeked Binds
173 --
174 -- DESCRIPTION
175 -- This procedure removes peeked binds from the advisor plans table.
176 --
177 -- PARAMETERS:
178 -- task_id (IN) - SPA task id
179 --
180 -- RETURNS:
181 -- NONE
182 --
183 -----------------------------------------------------------------------------
184 PROCEDURE remove_spa_peeked_binds(task_id IN NUMBER);
185
186
187 ----------------------------- cleanup_masking -------------------------------
188 -- NAME:
189 -- cleanup_masking - Cleanup Masking run
190 --
191 -- DESCRIPTION
192 -- This procedure removes data from all catalog tables related to the
193 -- given script id.
194 --
195 -- PARAMETERS:
196 -- script_id (IN) - id of masking script
197 --
198 -- RETURNS:
199 -- NONE
200 --
201 -----------------------------------------------------------------------------
202 PROCEDURE cleanup_masking(script_id IN NUMBER);
203
204 END dbms_rat_mask;