-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathuninstall_objects.sql
More file actions
429 lines (243 loc) · 8.49 KB
/
uninstall_objects.sql
File metadata and controls
429 lines (243 loc) · 8.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
set echo off
declare
procedure drop_if_exists(a_object_type varchar2, a_object_name varchar2) is
l_count integer;
begin
select count(1)
into l_count
from all_objects
where owner = sys_context('USERENV','CURRENT_SCHEMA')
and object_type = a_object_type
and object_name = a_object_name;
if l_count > 0 then
execute immediate 'drop '||a_object_type||' '||a_object_name;
dbms_output.put_line(initcap(a_object_type)||' '||a_object_name||' dropped.');
else
dbms_output.put_line(initcap(a_object_type)||' '||a_object_name||' was not dropped, '||lower(a_object_type)||' does not exist.');
end if;
end;
begin
drop_if_exists('TRIGGER', 'UT_TRIGGER_ANNOTATION_PARSING');
drop_if_exists('SYNONYM','UT3_TRIGGER_ALIVE');
end;
/
set echo on
drop synonym be_between;
drop synonym have_count;
drop synonym match;
drop synonym contain;
drop synonym be_false;
drop synonym be_empty;
drop synonym be_greater_or_equal;
drop synonym be_greater_than;
drop synonym be_less_or_equal;
drop synonym be_less_than;
drop synonym be_like;
drop synonym be_not_null;
drop synonym be_null;
drop synonym be_true;
drop synonym equal;
drop synonym be_within;
drop synonym be_within_pct;
drop type ut_coveralls_reporter force;
drop type ut_coverage_sonar_reporter force;
drop type ut_coverage_cobertura_reporter force;
drop package ut_coverage_report_html_helper;
drop type ut_coverage_html_reporter force;
drop type ut_sonar_test_reporter force;
drop type ut_realtime_reporter force;
drop package ut_coverage;
drop package ut_coverage_helper;
drop table ut_coverage_sources_tmp purge;
drop table ut_coverage_runs purge;
drop package ut_teamcity_reporter_helper;
drop package ut_runner;
drop type ut_suite_items_info force;
drop type ut_suite_item_info force;
drop type ut_path_items force;
drop type ut_path_item force;
drop package ut_suite_manager;
drop package ut_suite_builder;
drop package ut_suite_tag_filter;
drop package ut_suite_cache_manager;
drop table ut_suite_cache purge;
drop type ut_suite_cache_rows force;
drop type ut_suite_cache_row force;
drop sequence ut_suite_cache_seq;
drop table ut_suite_cache_package purge;
drop table ut_suite_cache_schema purge;
drop package ut;
drop table ut_dbms_output_cache purge;
drop type ut_expectation_compound force;
drop type ut_expectation_json force;
drop type ut_expectation force;
drop package ut_expectation_processor;
drop type ut_match force;
drop type ut_be_between force;
drop type ut_contain force;
drop type ut_equal force;
drop type ut_be_true force;
drop type ut_be_null force;
drop type ut_be_not_null force;
drop type ut_be_like force;
drop type ut_be_greater_or_equal force;
drop type ut_be_empty force;
drop type ut_be_greater_than force;
drop type ut_be_less_or_equal force;
drop type ut_be_less_than force;
drop type ut_be_false force;
drop type ut_be_within_pct force;
drop type ut_be_within force;
drop package ut_be_within_helper;
drop type ut_comparison_matcher force;
drop type ut_matcher force;
drop type ut_expectation_base force;
drop type ut_matcher_base force;
drop type ut_data_value_yminterval force;
drop type ut_data_value_varchar2 force;
drop type ut_data_value_timestamp_tz force;
drop type ut_data_value_timestamp_ltz force;
drop type ut_data_value_timestamp force;
drop type ut_data_value_number force;
drop type ut_data_value_refcursor force;
drop type ut_data_value_json force;
drop type ut_data_value_dsinterval force;
drop type ut_data_value_date force;
drop type ut_data_value_clob force;
drop type ut_data_value_boolean force;
drop type ut_data_value_blob force;
drop type ut_data_value_anydata force;
drop type ut_data_value_xmltype force;
drop type ut_data_value force;
drop type ut_matcher_options force;
drop type ut_matcher_options_items force;
drop type ut_json_tree_details force;
drop type ut_json_leaf_tab force;
drop type ut_json_leaf;
drop type ut_cursor_details force;
drop type ut_cursor_column_tab force;
drop type ut_cursor_column force;
drop table ut_compound_data_tmp purge;
drop table ut_compound_data_diff_tmp purge;
drop table ut_json_data_diff_tmp purge;
drop package ut_annotation_manager;
drop package ut_annotation_parser;
drop package ut_annotation_cache_manager;
drop table ut_annotation_cache cascade constraints purge;
drop table ut_annotation_cache_info cascade constraints purge;
drop table ut_annotation_cache_schema cascade constraints purge;
drop sequence ut_annotation_cache_seq;
drop type ut_annotation_objs_cache_info force;
drop type ut_annotation_obj_cache_info force;
drop type ut_annotated_objects force;
drop type ut_annotated_object force;
drop type ut_annotations force;
drop type ut_annotation force;
drop package ut_trigger_check;
drop package ut_file_mapper;
drop package ut_metadata;
drop package ut_ansiconsole_helper;
begin
null;
$if dbms_db_version.version < 21 $then
begin execute immediate 'drop type json force'; exception when others then null; end;
$end
$if dbms_db_version.version = 12 and dbms_db_version.release = 1 or dbms_db_version.version < 12 $then
begin execute immediate 'drop type json_element_t force'; exception when others then null; end;
begin execute immediate 'drop type json_object_t force'; exception when others then null; end;
begin execute immediate 'drop type json_array_t force'; exception when others then null; end;
begin execute immediate 'drop type json_key_list force'; exception when others then null; end;
$end
end;
/
drop package ut_utils;
drop type ut_stack force;
drop sequence ut_savepoint_seq;
drop type ut_documentation_reporter force;
drop type ut_debug_reporter force;
drop type ut_teamcity_reporter force;
drop type ut_xunit_reporter force;
drop type ut_junit_reporter force;
drop type ut_tfs_junit_reporter force;
drop type ut_event_listener force;
drop type ut_output_reporter_base force;
drop type ut_coverage_reporter_base force;
drop type ut_reporters force;
drop type ut_reporter_base force;
drop type ut_run force;
drop type ut_coverage_options force;
drop type ut_file_mappings force;
drop type ut_file_mapping force;
drop type ut_suite_context force;
drop type ut_suite force;
drop type ut_logical_suite force;
drop type ut_test force;
drop type ut_console_reporter_base force;
drop type ut_executable_test force;
drop type ut_executables force;
drop type ut_executable force;
drop type ut_suite_items force;
drop type ut_suite_item force;
drop type ut_output_table_buffer force;
drop type ut_output_clob_table_buffer force;
drop type ut_output_bulk_buffer force;
drop type ut_output_buffer_base force;
drop table ut_output_buffer_tmp purge;
drop sequence ut_output_buffer_tmp_seq;
drop table ut_output_clob_buffer_tmp purge;
drop sequence ut_output_clob_buffer_tmp_seq;
drop table ut_output_buffer_info_tmp purge;
drop package ut_session_context;
drop type ut_session_info force;
drop type ut_output_data_rows force;
drop type ut_output_data_row force;
drop type ut_results_counter force;
drop type ut_run_info force;
drop type ut_expectation_results force;
drop type ut_expectation_result force;
drop package ut_event_manager;
drop type ut_event_item force;
drop type ut_reporters_info force;
drop type ut_reporter_info force;
drop type ut_key_anyval_pair force;
drop type ut_key_anyval_pairs force;
drop type ut_key_value_pairs force;
drop type ut_key_value_pair force;
drop type ut_key_anyvalues force;
drop type ut_object_names force;
drop type ut_object_name force;
drop type ut_integer_list force;
drop type ut_varchar2_list force;
drop type ut_varchar2_rows force;
drop package ut_coverage_profiler;
drop package ut_compound_data_helper;
drop package ut_coverage_helper_profiler;
drop type ut_have_count;
drop type ut_compound_data_value;
set echo off
set feedback off
declare
i integer := 0;
begin
dbms_output.put_line('Dropping packages created for 12.2+ ' || upper('&&ut3_owner'));
for pkg in (
select object_name, owner
from all_objects
where 1 = 1
and owner = upper('&&ut3_owner')
and object_type = 'PACKAGE'
and object_name in ('UT_COVERAGE_HELPER_BLOCK','UT_COVERAGE_BLOCK'))
loop
begin
execute immediate 'drop package ' || pkg.owner || '.' || pkg.object_name;
dbms_output.put_line('Dropped '|| pkg.object_name);
i := i + 1;
exception
when others then
dbms_output.put_line('FAILED to drop ' || pkg.object_name);
end;
end loop;
dbms_output.put_line('&&line_separator');
dbms_output.put_line(i || ' packages dropped');
end;
/