From 14eca7f6422aaf8998ead771fc53004c94d5d736 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Tue, 17 Aug 2021 23:35:47 +0100 Subject: [PATCH 1/2] Adding noparallel hint to elements causing issues on parallel-enabled servers. --- .../ut_annotation_cache_manager.pkb | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/source/core/annotations/ut_annotation_cache_manager.pkb b/source/core/annotations/ut_annotation_cache_manager.pkb index 4882108fc..475e05536 100644 --- a/source/core/annotations/ut_annotation_cache_manager.pkb +++ b/source/core/annotations/ut_annotation_cache_manager.pkb @@ -21,12 +21,12 @@ create or replace package body ut_annotation_cache_manager as l_timestamp timestamp := systimestamp; pragma autonomous_transaction; begin - update ut_annotation_cache_schema s + update /*+ noparallel */ ut_annotation_cache_schema s set s.max_parse_time = l_timestamp where s.object_type = a_object.object_type and s.object_owner = a_object.object_owner; if sql%rowcount = 0 then - insert into ut_annotation_cache_schema s + insert /*+ noparallel */ into ut_annotation_cache_schema s (object_owner, object_type, max_parse_time) values (a_object.object_owner, a_object.object_type, l_timestamp); end if; @@ -34,7 +34,7 @@ create or replace package body ut_annotation_cache_manager as -- if not in trigger, or object has annotations if ora_sysevent is null or a_object.annotations is not null and a_object.annotations.count > 0 then - update ut_annotation_cache_info i + update /*+ noparallel */ ut_annotation_cache_info i set i.parse_time = l_timestamp where (i.object_owner, i.object_name, i.object_type) in ((a_object.object_owner, a_object.object_name, a_object.object_type)) @@ -42,7 +42,7 @@ create or replace package body ut_annotation_cache_manager as if sql%rowcount = 0 then - insert into ut_annotation_cache_info + insert /*+ noparallel */ into ut_annotation_cache_info (cache_id, object_owner, object_name, object_type, parse_time) values (ut_annotation_cache_seq.nextval, a_object.object_owner, a_object.object_name, a_object.object_type, l_timestamp) returning cache_id into l_cache_id; @@ -50,10 +50,10 @@ create or replace package body ut_annotation_cache_manager as end if; - delete from ut_annotation_cache c where cache_id = l_cache_id; + delete /*+ noparallel */ from ut_annotation_cache c where cache_id = l_cache_id; if a_object.annotations is not null and a_object.annotations.count > 0 then - insert into ut_annotation_cache + insert /*+ noparallel */ into ut_annotation_cache (cache_id, annotation_position, annotation_name, annotation_text, subobject_name) select l_cache_id, a.position, a.name, a.text, a.subobject_name from table(a_object.annotations) a; @@ -67,7 +67,7 @@ create or replace package body ut_annotation_cache_manager as pragma autonomous_transaction; begin - delete from ut_annotation_cache c + delete /*+ noparallel */ from ut_annotation_cache c where c.cache_id in (select i.cache_id from ut_annotation_cache_info i @@ -78,7 +78,7 @@ create or replace package body ut_annotation_cache_manager as and o.needs_refresh = 'Y' ); - update ut_annotation_cache_schema s + update /*+ noparallel */ ut_annotation_cache_schema s set s.max_parse_time = l_timestamp where (s.object_owner, s.object_type) in ( @@ -88,14 +88,15 @@ create or replace package body ut_annotation_cache_manager as ); if sql%rowcount = 0 then - insert into ut_annotation_cache_schema s + insert /*+ noparallel */ into ut_annotation_cache_schema s (object_owner, object_type, max_parse_time) select distinct o.object_owner, o.object_type, l_timestamp from table(a_objects) o where o.needs_refresh = 'Y'; end if; - merge into ut_annotation_cache_info i + merge /*+ noparallel */ + into ut_annotation_cache_info i using (select o.object_name, o.object_type, o.object_owner from table(a_objects) o where o.needs_refresh = 'Y' @@ -149,7 +150,7 @@ create or replace package body ut_annotation_cache_manager as procedure set_fully_refreshed(a_object_owner varchar2, a_object_type varchar2) is pragma autonomous_transaction; begin - update ut_annotation_cache_schema s + update /*+ noparallel */ ut_annotation_cache_schema s set s.full_refresh_time = s.max_parse_time where s.object_owner = a_object_owner and s.object_type = a_object_type; @@ -160,7 +161,7 @@ create or replace package body ut_annotation_cache_manager as pragma autonomous_transaction; begin - delete from ut_annotation_cache_info i + delete /*+ noparallel */ from ut_annotation_cache_info i where exists ( select 1 from table (a_objects) o where o.object_name = i.object_name @@ -206,13 +207,13 @@ create or replace package body ut_annotation_cache_manager as l_filter := l_filter || ' and ' || case when a_object_type is null then ':a_object_type is null' else 'object_type = :a_object_type' end; l_cache_filter := ' c.cache_id in (select i.cache_id from ut_annotation_cache_info i where ' || l_filter || ' )'; end if; - execute immediate 'delete from ut_annotation_cache c where ' || l_cache_filter + execute immediate 'delete /*+ noparallel */ from ut_annotation_cache c where ' || l_cache_filter using a_object_owner, a_object_type; - execute immediate ' delete from ut_annotation_cache_info i where ' || l_filter + execute immediate ' delete /*+ noparallel */ from ut_annotation_cache_info i where ' || l_filter using a_object_owner, a_object_type; - execute immediate ' delete from ut_annotation_cache_schema s where ' || l_filter + execute immediate ' delete /*+ noparallel */ from ut_annotation_cache_schema s where ' || l_filter using a_object_owner, a_object_type; commit; From f35694e744e2bd8d322a0f3a153cfe54c36b5525 Mon Sep 17 00:00:00 2001 From: Jacek Gebal Date: Sun, 7 Nov 2021 22:34:57 +0200 Subject: [PATCH 2/2] Added no_parallel hints to all SQLs to assure stable performance on parallel-enabled systems. --- source/api/ut.pkb | 2 +- source/check_object_grants.sql | 2 +- .../ut_annotation_cache_manager.pkb | 50 +++++++++---------- .../annotations/ut_annotation_manager.pkb | 12 ++--- .../core/annotations/ut_annotation_parser.pkb | 2 +- source/core/coverage/ut_coverage.pkb | 2 +- source/core/coverage/ut_coverage_helper.pkb | 10 ++-- .../coverage/ut_coverage_helper_block.pkb | 3 +- .../coverage/ut_coverage_helper_profiler.pkb | 2 +- .../coverage/ut_coverage_reporter_base.tpb | 4 +- .../output_buffers/ut_output_buffer_base.tpb | 8 +-- .../ut_output_clob_table_buffer.tpb | 14 +++--- .../output_buffers/ut_output_table_buffer.tpb | 14 +++--- source/core/types/ut_output_reporter_base.tpb | 2 +- source/core/types/ut_run_info.tpb | 10 ++-- source/core/ut_dbms_output_cache.sql | 2 +- source/core/ut_expectation_processor.pkb | 2 +- source/core/ut_metadata.pkb | 10 ++-- source/core/ut_suite_cache_manager.pkb | 50 +++++++++---------- source/core/ut_suite_manager.pkb | 10 ++-- source/core/ut_utils.pkb | 16 +++--- .../data_values/ut_compound_data_helper.pkb | 20 ++++---- .../data_values/ut_cursor_details.tpb | 16 +++--- .../data_values/ut_data_value_anydata.tpb | 4 +- .../data_values/ut_data_value_refcursor.tpb | 2 +- source/reporters/ut_debug_reporter.tpb | 2 +- 26 files changed, 136 insertions(+), 135 deletions(-) diff --git a/source/api/ut.pkb b/source/api/ut.pkb index 3b94a2bf7..81d3e59a7 100644 --- a/source/api/ut.pkb +++ b/source/api/ut.pkb @@ -674,7 +674,7 @@ create or replace package body ut is procedure set_nls is begin if g_nls_date_format is null then - select nsp.value + select /*+ no_parallel */ nsp.value into g_nls_date_format from nls_session_parameters nsp where parameter = 'NLS_DATE_FORMAT'; diff --git a/source/check_object_grants.sql b/source/check_object_grants.sql index d499ced9c..5f560e6b1 100644 --- a/source/check_object_grants.sql +++ b/source/check_object_grants.sql @@ -24,7 +24,7 @@ begin l_target_table := get_view('dba_tab_privs'); l_owner_column := case when l_target_table like 'dba%' then 'owner' else 'table_schema' end; execute immediate q'[ - select listagg(' - '||object_name,CHR(10)) within group(order by object_name) + select /*+ no_parallel */ listagg(' - '||object_name,CHR(10)) within group(order by object_name) from ( select column_value as object_name from table(:l_expected_grants) diff --git a/source/core/annotations/ut_annotation_cache_manager.pkb b/source/core/annotations/ut_annotation_cache_manager.pkb index 475e05536..cef6fa519 100644 --- a/source/core/annotations/ut_annotation_cache_manager.pkb +++ b/source/core/annotations/ut_annotation_cache_manager.pkb @@ -21,12 +21,12 @@ create or replace package body ut_annotation_cache_manager as l_timestamp timestamp := systimestamp; pragma autonomous_transaction; begin - update /*+ noparallel */ ut_annotation_cache_schema s + update /*+ no_parallel */ ut_annotation_cache_schema s set s.max_parse_time = l_timestamp where s.object_type = a_object.object_type and s.object_owner = a_object.object_owner; if sql%rowcount = 0 then - insert /*+ noparallel */ into ut_annotation_cache_schema s + insert /*+ no_parallel */ into ut_annotation_cache_schema s (object_owner, object_type, max_parse_time) values (a_object.object_owner, a_object.object_type, l_timestamp); end if; @@ -34,7 +34,7 @@ create or replace package body ut_annotation_cache_manager as -- if not in trigger, or object has annotations if ora_sysevent is null or a_object.annotations is not null and a_object.annotations.count > 0 then - update /*+ noparallel */ ut_annotation_cache_info i + update /*+ no_parallel */ ut_annotation_cache_info i set i.parse_time = l_timestamp where (i.object_owner, i.object_name, i.object_type) in ((a_object.object_owner, a_object.object_name, a_object.object_type)) @@ -42,7 +42,7 @@ create or replace package body ut_annotation_cache_manager as if sql%rowcount = 0 then - insert /*+ noparallel */ into ut_annotation_cache_info + insert /*+ no_parallel */ into ut_annotation_cache_info (cache_id, object_owner, object_name, object_type, parse_time) values (ut_annotation_cache_seq.nextval, a_object.object_owner, a_object.object_name, a_object.object_type, l_timestamp) returning cache_id into l_cache_id; @@ -50,12 +50,12 @@ create or replace package body ut_annotation_cache_manager as end if; - delete /*+ noparallel */ from ut_annotation_cache c where cache_id = l_cache_id; + delete /*+ no_parallel */ from ut_annotation_cache c where cache_id = l_cache_id; if a_object.annotations is not null and a_object.annotations.count > 0 then - insert /*+ noparallel */ into ut_annotation_cache + insert /*+ no_parallel */ into ut_annotation_cache (cache_id, annotation_position, annotation_name, annotation_text, subobject_name) - select l_cache_id, a.position, a.name, a.text, a.subobject_name + select /*+ no_parallel */ l_cache_id, a.position, a.name, a.text, a.subobject_name from table(a_object.annotations) a; end if; commit; @@ -67,9 +67,9 @@ create or replace package body ut_annotation_cache_manager as pragma autonomous_transaction; begin - delete /*+ noparallel */ from ut_annotation_cache c + delete /*+ no_parallel */ from ut_annotation_cache c where c.cache_id - in (select i.cache_id + in (select /*+ no_parallel */ i.cache_id from ut_annotation_cache_info i join table (a_objects) o on o.object_name = i.object_name @@ -78,26 +78,26 @@ create or replace package body ut_annotation_cache_manager as and o.needs_refresh = 'Y' ); - update /*+ noparallel */ ut_annotation_cache_schema s + update /*+ no_parallel */ ut_annotation_cache_schema s set s.max_parse_time = l_timestamp where (s.object_owner, s.object_type) in ( - select o.object_owner, o.object_type + select /*+ no_parallel */ o.object_owner, o.object_type from table(a_objects) o where o.needs_refresh = 'Y' ); if sql%rowcount = 0 then - insert /*+ noparallel */ into ut_annotation_cache_schema s + insert /*+ no_parallel */ into ut_annotation_cache_schema s (object_owner, object_type, max_parse_time) - select distinct o.object_owner, o.object_type, l_timestamp + select /*+ no_parallel */ distinct o.object_owner, o.object_type, l_timestamp from table(a_objects) o where o.needs_refresh = 'Y'; end if; - merge /*+ noparallel */ + merge /*+ no_parallel */ into ut_annotation_cache_info i - using (select o.object_name, o.object_type, o.object_owner + using (select /*+ no_parallel */ o.object_name, o.object_type, o.object_owner from table(a_objects) o where o.needs_refresh = 'Y' ) o @@ -117,7 +117,7 @@ create or replace package body ut_annotation_cache_manager as function get_cached_objects_list(a_object_owner varchar2, a_object_type varchar2, a_parsed_after timestamp := null) return ut_annotation_objs_cache_info is l_result ut_annotation_objs_cache_info; begin - select ut_annotation_obj_cache_info( + select /*+ no_parallel */ ut_annotation_obj_cache_info( object_owner => i.object_owner, object_name => i.object_name, object_type => i.object_type, @@ -136,7 +136,7 @@ create or replace package body ut_annotation_cache_manager as l_result t_cache_schema_info; begin begin - select * + select /*+ no_parallel */ * into l_result from ut_annotation_cache_schema s where s.object_type = a_object_type and s.object_owner = a_object_owner; @@ -150,7 +150,7 @@ create or replace package body ut_annotation_cache_manager as procedure set_fully_refreshed(a_object_owner varchar2, a_object_type varchar2) is pragma autonomous_transaction; begin - update /*+ noparallel */ ut_annotation_cache_schema s + update /*+ no_parallel */ ut_annotation_cache_schema s set s.full_refresh_time = s.max_parse_time where s.object_owner = a_object_owner and s.object_type = a_object_type; @@ -161,9 +161,9 @@ create or replace package body ut_annotation_cache_manager as pragma autonomous_transaction; begin - delete /*+ noparallel */ from ut_annotation_cache_info i + delete /*+ no_parallel */ from ut_annotation_cache_info i where exists ( - select 1 from table (a_objects) o + select /*+ no_parallel */ 1 from table (a_objects) o where o.object_name = i.object_name and o.object_type = i.object_type and o.object_owner = i.object_owner @@ -176,7 +176,7 @@ create or replace package body ut_annotation_cache_manager as l_results sys_refcursor; begin open l_results for - select ut_annotated_object( + select /*+ no_parallel */ ut_annotated_object( i.object_owner, i.object_name, i.object_type, i.parse_time, cast( collect( @@ -205,15 +205,15 @@ create or replace package body ut_annotation_cache_manager as else l_filter := case when a_object_owner is null then ':a_object_owner is null' else 'object_owner = :a_object_owner' end; l_filter := l_filter || ' and ' || case when a_object_type is null then ':a_object_type is null' else 'object_type = :a_object_type' end; - l_cache_filter := ' c.cache_id in (select i.cache_id from ut_annotation_cache_info i where ' || l_filter || ' )'; + l_cache_filter := ' c.cache_id in (select /*+ no_parallel */ i.cache_id from ut_annotation_cache_info i where ' || l_filter || ' )'; end if; - execute immediate 'delete /*+ noparallel */ from ut_annotation_cache c where ' || l_cache_filter + execute immediate 'delete /*+ no_parallel */ from ut_annotation_cache c where ' || l_cache_filter using a_object_owner, a_object_type; - execute immediate ' delete /*+ noparallel */ from ut_annotation_cache_info i where ' || l_filter + execute immediate ' delete /*+ no_parallel */ from ut_annotation_cache_info i where ' || l_filter using a_object_owner, a_object_type; - execute immediate ' delete /*+ noparallel */ from ut_annotation_cache_schema s where ' || l_filter + execute immediate ' delete /*+ no_parallel */ from ut_annotation_cache_schema s where ' || l_filter using a_object_owner, a_object_type; commit; diff --git a/source/core/annotations/ut_annotation_manager.pkb b/source/core/annotations/ut_annotation_manager.pkb index c9de1c7e4..ca0c358cf 100644 --- a/source/core/annotations/ut_annotation_manager.pkb +++ b/source/core/annotations/ut_annotation_manager.pkb @@ -34,7 +34,7 @@ create or replace package body ut_annotation_manager as l_cached_objects := ut_annotation_cache_manager.get_cached_objects_list( a_object_owner, a_object_type ); if l_cached_objects is not empty then - execute immediate 'select /*+ cardinality(i '||ut_utils.scale_cardinality(cardinality(l_cached_objects))||') */ + execute immediate 'select /*+ no_parallel cardinality(i '||ut_utils.scale_cardinality(cardinality(l_cached_objects))||') */ value(i) from table( :l_data ) i where @@ -71,7 +71,7 @@ create or replace package body ut_annotation_manager as --limit the list to objects that exist and are visible to the invoking user --enrich the list by info about cache validity execute immediate - 'select /*+ cardinality(i '||ut_utils.scale_cardinality(cardinality(l_cached_objects))||') */ + 'select /*+ no_parallel cardinality(i '||ut_utils.scale_cardinality(cardinality(l_cached_objects))||') */ '||l_ut_owner||q'[.ut_annotation_obj_cache_info( object_owner => o.owner, object_name => o.object_name, @@ -108,7 +108,7 @@ create or replace package body ut_annotation_manager as begin l_card := ut_utils.scale_cardinality(cardinality(a_objects_to_refresh)); open l_result for - q'[select x.name, x.text + q'[select /*+ no_parallel */ x.name, x.text from (select /*+ cardinality( r ]'||l_card||q'[ )*/ s.name, s.text, s.line, max(case when s.text like '%--%\%%' escape '\' @@ -252,7 +252,7 @@ create or replace package body ut_annotation_manager as l_sql_lines := ut_utils.convert_collection( ut_utils.clob_to_table(l_sql_clob) ); end if; open l_result for - select a_object_name as name, column_value||chr(10) as text from table(l_sql_lines); + select /*+ no_parallel */ a_object_name as name, column_value||chr(10) as text from table(l_sql_lines); return l_result; end; @@ -261,7 +261,7 @@ create or replace package body ut_annotation_manager as l_sources_view varchar2(200) := ut_metadata.get_source_view_name(); begin open l_result for - q'[select :a_object_name, s.text + q'[select /*+ no_parallel */ :a_object_name, s.text from ]'||l_sources_view||q'[ s where s.type = :a_object_type and s.owner = :a_object_owner @@ -279,7 +279,7 @@ create or replace package body ut_annotation_manager as 'GSMCATUSER','GSMUSER','ORACLE_OCM','OUTLN','REMOTE_SCHEDULER_AGENT','SYS','SYS$UMF', 'SYSBACKUP','SYSDG','SYSKM','SYSRAC','SYSTEM','WMSYS','XDB','XS$NULL'); $else - select username bulk collect into l_restricted_users + select /*+ no_parallel */ username bulk collect into l_restricted_users from all_users where oracle_maintained = 'Y'; $end if ora_dict_obj_owner member of l_restricted_users then diff --git a/source/core/annotations/ut_annotation_parser.pkb b/source/core/annotations/ut_annotation_parser.pkb index 6248f36b9..6ef15a3ac 100644 --- a/source/core/annotations/ut_annotation_parser.pkb +++ b/source/core/annotations/ut_annotation_parser.pkb @@ -210,7 +210,7 @@ create or replace package body ut_annotation_parser as dbms_lob.freetemporary(l_source); - select value(x) bulk collect into l_result from table(l_annotations) x order by x.position; + select /*+ no_parallel */ value(x) bulk collect into l_result from table(l_annotations) x order by x.position; return l_result; end parse_object_annotations; diff --git a/source/core/coverage/ut_coverage.pkb b/source/core/coverage/ut_coverage.pkb index 81d17704a..1900e6c3c 100644 --- a/source/core/coverage/ut_coverage.pkb +++ b/source/core/coverage/ut_coverage.pkb @@ -77,7 +77,7 @@ create or replace package body ut_coverage is end as to_be_skipped from sources s ) - select full_name, owner, name, type, line, to_be_skipped, text + select /*+ no_parallel */ full_name, owner, name, type, line, to_be_skipped, text from coverage_sources s -- Exclude calls to utPLSQL framework, Unit Test packages and objects from a_exclude_list parameter of coverage reporter where (s.owner, s.name) not in ( select /*+ cardinality(el {skipped_objects_cardinality})*/el.owner, el.name from table(:l_skipped_objects) el ) diff --git a/source/core/coverage/ut_coverage_helper.pkb b/source/core/coverage/ut_coverage_helper.pkb index 4c41aa2f6..a000237c6 100644 --- a/source/core/coverage/ut_coverage_helper.pkb +++ b/source/core/coverage/ut_coverage_helper.pkb @@ -35,7 +35,7 @@ create or replace package body ut_coverage_helper is procedure insert_into_tmp_table(a_data t_coverage_sources_tmp_rows) is begin forall i in 1 .. a_data.count - insert into ut_coverage_sources_tmp + insert /*+ no_parallel */ into ut_coverage_sources_tmp (full_name,owner,name,type,line,text,to_be_skipped) values(a_data(i).full_name,a_data(i).owner,a_data(i).name,a_data(i).type,a_data(i).line,a_data(i).text,a_data(i).to_be_skipped); end; @@ -49,7 +49,7 @@ create or replace package body ut_coverage_helper is function is_tmp_table_populated return boolean is l_result integer; begin - select 1 into l_result from ut_coverage_sources_tmp where rownum = 1; + select /*+ no_parallel */ 1 into l_result from ut_coverage_sources_tmp where rownum = 1; return (l_result = 1); exception when no_data_found then @@ -60,7 +60,7 @@ create or replace package body ut_coverage_helper is l_result t_tmp_table_objects_crsr; begin open l_result for - select o.owner, o.name, o.type, o.full_name, max(o.line) as lines_count, + select /*+ no_parallel */ o.owner, o.name, o.type, o.full_name, max(o.line) as lines_count, cast( collect(decode(to_be_skipped, 'Y', to_char(line))) as ut_varchar2_list ) as to_be_skipped_list @@ -73,7 +73,7 @@ create or replace package body ut_coverage_helper is function get_tmp_table_object_lines(a_owner varchar2, a_object_name varchar2) return ut_varchar2_list is l_result ut_varchar2_list; begin - select rtrim(s.text,chr(10)) as text + select /*+ no_parallel */ rtrim(s.text,chr(10)) as text bulk collect into l_result from ut_coverage_sources_tmp s where s.owner = a_owner @@ -86,7 +86,7 @@ create or replace package body ut_coverage_helper is procedure set_coverage_run_ids( a_coverage_run_id raw, a_line_coverage_id integer, a_block_coverage_id integer ) is pragma autonomous_transaction; begin - insert into ut_coverage_runs + insert /*+ no_parallel */ into ut_coverage_runs ( coverage_run_id, line_coverage_id, block_coverage_id ) values ( a_coverage_run_id, a_line_coverage_id, a_block_coverage_id ); diff --git a/source/core/coverage/ut_coverage_helper_block.pkb b/source/core/coverage/ut_coverage_helper_block.pkb index e030f2c37..913b0fb4c 100644 --- a/source/core/coverage/ut_coverage_helper_block.pkb +++ b/source/core/coverage/ut_coverage_helper_block.pkb @@ -46,7 +46,8 @@ create or replace package body ut_coverage_helper_block is l_ut_owner varchar2(250) := ut_utils.ut_owner; begin execute immediate q'[ - select line as line, + select /*+ no_parallel */ + line as line, count(block) as blocks, sum(covered) as covered_blocks from (select line, diff --git a/source/core/coverage/ut_coverage_helper_profiler.pkb b/source/core/coverage/ut_coverage_helper_profiler.pkb index dacfcbaa3..22aa6619d 100644 --- a/source/core/coverage/ut_coverage_helper_profiler.pkb +++ b/source/core/coverage/ut_coverage_helper_profiler.pkb @@ -58,7 +58,7 @@ create or replace package body ut_coverage_helper_profiler is function proftab_results(a_object ut_coverage_helper.t_tmp_table_object, a_coverage_run_id raw) return t_proftab_rows is l_coverage_rows t_proftab_rows; begin - select + select /*+ no_parallel */ d.line#, case when sum(d.total_occur) = 0 and sum(d.total_time) > 0 then 1 else sum(d.total_occur) end total_occur bulk collect into l_coverage_rows diff --git a/source/core/coverage/ut_coverage_reporter_base.tpb b/source/core/coverage/ut_coverage_reporter_base.tpb index 96c4b5066..1cc856ea6 100644 --- a/source/core/coverage/ut_coverage_reporter_base.tpb +++ b/source/core/coverage/ut_coverage_reporter_base.tpb @@ -93,7 +93,7 @@ create or replace type body ut_coverage_reporter_base is (l_reporter as ut_output_reporter_base).before_calling_run(null); l_reporter.after_calling_run( ut_run( a_coverage_options => a_coverage_options, a_client_character_set => a_client_character_set ) ); l_reporter.on_finalize(null); - for i in (select x.text from table(l_reporter.get_lines(1, 1)) x ) loop + for i in (select /*+ no_parallel */ x.text from table(l_reporter.get_lines(1, 1)) x ) loop pipe row (i.text); end loop; return; @@ -107,7 +107,7 @@ create or replace type body ut_coverage_reporter_base is (l_reporter as ut_output_reporter_base).before_calling_run(null); l_reporter.after_calling_run( ut_run( a_coverage_options => a_coverage_options, a_client_character_set => a_client_character_set ) ); l_reporter.on_finalize(null); - open l_result for select x.text from table(l_reporter.get_lines(1, 1)) x; + open l_result for select /*+ no_parallel */ x.text from table(l_reporter.get_lines(1, 1)) x; return l_result; end; diff --git a/source/core/output_buffers/ut_output_buffer_base.tpb b/source/core/output_buffers/ut_output_buffer_base.tpb index 38f008e75..412f30836 100644 --- a/source/core/output_buffers/ut_output_buffer_base.tpb +++ b/source/core/output_buffers/ut_output_buffer_base.tpb @@ -25,11 +25,11 @@ create or replace type body ut_output_buffer_base is self.output_id := coalesce(a_output_id, self.output_id, sys_guid()); self.start_date := coalesce(self.start_date, sysdate); self.last_message_id := 0; - select count(*) into l_exists from ut_output_buffer_info_tmp where output_id = self.output_id; + select /*+ no_parallel */ count(*) into l_exists from ut_output_buffer_info_tmp where output_id = self.output_id; if ( l_exists > 0 ) then - update ut_output_buffer_info_tmp set start_date = self.start_date where output_id = self.output_id; + update /*+ no_parallel */ ut_output_buffer_info_tmp set start_date = self.start_date where output_id = self.output_id; else - insert into ut_output_buffer_info_tmp(output_id, start_date) values (self.output_id, self.start_date); + insert /*+ no_parallel */ into ut_output_buffer_info_tmp(output_id, start_date) values (self.output_id, self.start_date); end if; commit; self.is_closed := 0; @@ -39,7 +39,7 @@ create or replace type body ut_output_buffer_base is l_lines sys_refcursor; begin open l_lines for - select text, item_type + select /*+ no_parallel */ text, item_type from table(self.get_lines(a_initial_timeout, a_timeout_sec)); return l_lines; end; diff --git a/source/core/output_buffers/ut_output_clob_table_buffer.tpb b/source/core/output_buffers/ut_output_clob_table_buffer.tpb index 8c2825151..8d23b9422 100644 --- a/source/core/output_buffers/ut_output_clob_table_buffer.tpb +++ b/source/core/output_buffers/ut_output_clob_table_buffer.tpb @@ -26,7 +26,7 @@ create or replace type body ut_output_clob_table_buffer is pragma autonomous_transaction; begin self.last_message_id := self.last_message_id + 1; - insert into ut_output_clob_buffer_tmp(output_id, message_id, is_finished) + insert /*+ no_parallel */ into ut_output_clob_buffer_tmp(output_id, message_id, is_finished) values (self.output_id, self.last_message_id, 1); commit; self.is_closed := 1; @@ -37,7 +37,7 @@ create or replace type body ut_output_clob_table_buffer is begin if a_text is not null or a_item_type is not null then self.last_message_id := self.last_message_id + 1; - insert into ut_output_clob_buffer_tmp(output_id, message_id, text, item_type) + insert /*+ no_parallel */ into ut_output_clob_buffer_tmp(output_id, message_id, text, item_type) values (self.output_id, self.last_message_id, a_text, a_item_type); end if; commit; @@ -46,8 +46,8 @@ create or replace type body ut_output_clob_table_buffer is overriding member procedure send_lines(self in out nocopy ut_output_clob_table_buffer, a_text_list ut_varchar2_rows, a_item_type varchar2 := null) is pragma autonomous_transaction; begin - insert into ut_output_clob_buffer_tmp(output_id, message_id, text, item_type) - select self.output_id, self.last_message_id + rownum, t.column_value, a_item_type + insert /*+ no_parallel */ into ut_output_clob_buffer_tmp(output_id, message_id, text, item_type) + select /*+ no_parallel */ self.output_id, self.last_message_id + rownum, t.column_value, a_item_type from table(a_text_list) t where t.column_value is not null or a_item_type is not null; self.last_message_id := self.last_message_id + SQL%rowcount; @@ -59,7 +59,7 @@ create or replace type body ut_output_clob_table_buffer is begin if a_text is not null and a_text != empty_clob() or a_item_type is not null then self.last_message_id := self.last_message_id + 1; - insert into ut_output_clob_buffer_tmp(output_id, message_id, text, item_type) + insert /*+ no_parallel */ into ut_output_clob_buffer_tmp(output_id, message_id, text, item_type) values (self.output_id, self.last_message_id, a_text, a_item_type); end if; commit; @@ -102,13 +102,13 @@ create or replace type body ut_output_clob_table_buffer is begin while not l_finished loop with ordered_buffer as ( - select /*+ index(a) */ a.rowid, ut_output_data_row(a.text, a.item_type), is_finished + select /*+ no_parallel index(a) */ a.rowid, ut_output_data_row(a.text, a.item_type), is_finished from ut_output_clob_buffer_tmp a where a.output_id = self.output_id and a.message_id <= l_max_message_id order by a.message_id ) - select b.* + select /*+ no_parallel */ b.* bulk collect into l_message_rowids, l_buffer_data, l_finished_flags from ordered_buffer b; diff --git a/source/core/output_buffers/ut_output_table_buffer.tpb b/source/core/output_buffers/ut_output_table_buffer.tpb index e3f869b22..5f9c536f9 100644 --- a/source/core/output_buffers/ut_output_table_buffer.tpb +++ b/source/core/output_buffers/ut_output_table_buffer.tpb @@ -26,7 +26,7 @@ create or replace type body ut_output_table_buffer is pragma autonomous_transaction; begin self.last_message_id := self.last_message_id + 1; - insert into ut_output_buffer_tmp(output_id, message_id, is_finished) + insert /*+ no_parallel */ into ut_output_buffer_tmp(output_id, message_id, is_finished) values (self.output_id, self.last_message_id, 1); commit; self.is_closed := 1; @@ -45,7 +45,7 @@ create or replace type body ut_output_table_buffer is ); else self.last_message_id := self.last_message_id + 1; - insert into ut_output_buffer_tmp(output_id, message_id, text, item_type) + insert /*+ no_parallel */ into ut_output_buffer_tmp(output_id, message_id, text, item_type) values (self.output_id, self.last_message_id, a_text, a_item_type); end if; commit; @@ -55,8 +55,8 @@ create or replace type body ut_output_table_buffer is overriding member procedure send_lines(self in out nocopy ut_output_table_buffer, a_text_list ut_varchar2_rows, a_item_type varchar2 := null) is pragma autonomous_transaction; begin - insert into ut_output_buffer_tmp(output_id, message_id, text, item_type) - select self.output_id, self.last_message_id + rownum, t.column_value, a_item_type + insert /*+ no_parallel */ into ut_output_buffer_tmp(output_id, message_id, text, item_type) + select /*+ no_parallel */ self.output_id, self.last_message_id + rownum, t.column_value, a_item_type from table(a_text_list) t where t.column_value is not null or a_item_type is not null; self.last_message_id := self.last_message_id + SQL%rowcount; @@ -76,7 +76,7 @@ create or replace type body ut_output_table_buffer is ); else self.last_message_id := self.last_message_id + 1; - insert into ut_output_buffer_tmp(output_id, message_id, text, item_type) + insert /*+ no_parallel */ into ut_output_buffer_tmp(output_id, message_id, text, item_type) values (self.output_id, self.last_message_id, a_text, a_item_type); end if; commit; @@ -107,8 +107,8 @@ create or replace type body ut_output_table_buffer is ) is pragma autonomous_transaction; begin - delete from ( - select * + delete /*+ no_parallel */ from ( + select /*+ no_parallel */ * from ut_output_buffer_tmp o where o.output_id = self.output_id and o.message_id <= a_max_message_id diff --git a/source/core/types/ut_output_reporter_base.tpb b/source/core/types/ut_output_reporter_base.tpb index c4ba73ba5..b8dc24667 100644 --- a/source/core/types/ut_output_reporter_base.tpb +++ b/source/core/types/ut_output_reporter_base.tpb @@ -65,7 +65,7 @@ create or replace type body ut_output_reporter_base is final member function get_lines(a_initial_timeout natural := null, a_timeout_sec natural) return ut_output_data_rows pipelined is begin - for i in (select value(x) val from table(self.output_buffer.get_lines(a_initial_timeout, a_timeout_sec)) x ) loop + for i in (select /*+ no_parallel */ value(x) val from table(self.output_buffer.get_lines(a_initial_timeout, a_timeout_sec)) x ) loop pipe row (i.val); end loop; end; diff --git a/source/core/types/ut_run_info.tpb b/source/core/types/ut_run_info.tpb index 8e06d6137..ffa1a6372 100644 --- a/source/core/types/ut_run_info.tpb +++ b/source/core/types/ut_run_info.tpb @@ -20,27 +20,27 @@ create or replace type body ut_run_info as begin self.self_type := $$plsql_unit; execute immediate - 'select '||l_ut_owner||'.ut.version() from dual' + 'select /*+ no_parallel */ '||l_ut_owner||'.ut.version() from dual' into self.ut_version; dbms_utility.db_version( self.db_version, self.db_compatibility ); db_os_type := dbms_utility.port_string(); execute immediate - 'select '||l_ut_owner||'.ut_key_value_pair(x.product, x.version) from product_component_version x' + 'select /*+ no_parallel */ '||l_ut_owner||'.ut_key_value_pair(x.product, x.version) from product_component_version x' bulk collect into self.db_component_version; execute immediate - 'select '||l_ut_owner||'.ut_key_value_pair(x.parameter, x.value) + 'select /*+ no_parallel */ '||l_ut_owner||'.ut_key_value_pair(x.parameter, x.value) from nls_session_parameters x' bulk collect into self.nls_session_params; execute immediate - 'select '||l_ut_owner||'.ut_key_value_pair(x.parameter, x.value) from nls_instance_parameters x' + 'select /*+ no_parallel */ '||l_ut_owner||'.ut_key_value_pair(x.parameter, x.value) from nls_instance_parameters x' bulk collect into self.nls_instance_params; execute immediate - 'select '||l_ut_owner||'.ut_key_value_pair(x.parameter, x.value) from nls_database_parameters x' + 'select /*+ no_parallel */ '||l_ut_owner||'.ut_key_value_pair(x.parameter, x.value) from nls_database_parameters x' bulk collect into self.nls_db_params; return; end; diff --git a/source/core/ut_dbms_output_cache.sql b/source/core/ut_dbms_output_cache.sql index 1fe4251c7..3d4c12845 100644 --- a/source/core/ut_dbms_output_cache.sql +++ b/source/core/ut_dbms_output_cache.sql @@ -19,7 +19,7 @@ limitations under the License. declare l_tab_exist number; begin - select count(*) into l_tab_exist from + select /*+ no_parallel */ count(*) into l_tab_exist from (select table_name from all_tables where table_name = 'UT_DBMS_OUTPUT_CACHE' and owner = sys_context('USERENV','CURRENT_SCHEMA') union all select synonym_name from all_synonyms where synonym_name = 'UT_DBMS_OUTPUT_CACHE' and owner = sys_context('USERENV','CURRENT_SCHEMA')); diff --git a/source/core/ut_expectation_processor.pkb b/source/core/ut_expectation_processor.pkb index d65d210c8..22e268dca 100644 --- a/source/core/ut_expectation_processor.pkb +++ b/source/core/ut_expectation_processor.pkb @@ -104,7 +104,7 @@ create or replace package body ut_expectation_processor as function get_session_parameters return tt_nls_params is l_session_params tt_nls_params; begin - select nsp.parameter, nsp.value + select /*+ no_parallel */ nsp.parameter, nsp.value bulk collect into l_session_params from nls_session_parameters nsp where parameter diff --git a/source/core/ut_metadata.pkb b/source/core/ut_metadata.pkb index 727dd6318..3afc9d1c6 100644 --- a/source/core/ut_metadata.pkb +++ b/source/core/ut_metadata.pkb @@ -39,7 +39,7 @@ create or replace package body ut_metadata as l_view_name varchar2(200) := get_objects_view_name; begin - execute immediate q'[select count(*) + execute immediate q'[select /*+ no_parallel */ count(*) from ]'||l_view_name||q'[ where owner = :a_owner_name and object_name = :a_package_name @@ -58,7 +58,7 @@ create or replace package body ut_metadata as l_view_name varchar2(200) := get_dba_view('dba_procedures'); begin execute immediate - 'select count(*) from '||l_view_name + 'select /*+ no_parallel */ count(*) from '||l_view_name ||' where owner = :l_schema and object_name = :l_package_name and procedure_name = :l_procedure_name and rownum = 1' into l_cnt using a_owner_name, a_package_name, a_procedure_name; @@ -77,7 +77,7 @@ create or replace package body ut_metadata as if not nvl(c_key = g_cached_object, false) then g_cached_object := c_key; execute immediate - 'select trim(text) text + 'select /*+ no_parallel */ trim(text) text from '||l_view_name||q'[ s where s.owner = :a_owner and s.name = :a_object_name @@ -123,7 +123,7 @@ create or replace package body ut_metadata as function user_has_execute_any_proc return boolean is l_has_execute_any varchar2(1); begin - select decode( count( 1 ), 0, 'N', 'Y' ) + select /*+ no_parallel */ decode( count( 1 ), 0, 'N', 'Y' ) into l_has_execute_any from dual where @@ -157,7 +157,7 @@ create or replace package body ut_metadata as l_cnt number; c_current_schema constant all_tables.owner%type := sys_context('USERENV','CURRENT_SCHEMA'); begin - select count(*) + select /*+ no_parallel */ count(*) into l_cnt from all_objects t where t.object_name = a_object_name diff --git a/source/core/ut_suite_cache_manager.pkb b/source/core/ut_suite_cache_manager.pkb index 06c4c76a5..ebc9a839d 100644 --- a/source/core/ut_suite_cache_manager.pkb +++ b/source/core/ut_suite_cache_manager.pkb @@ -79,7 +79,7 @@ create or replace package body ut_suite_cache_manager is union all select obj from logical_suites ) - select c.obj + select /*+ no_parallel */ c.obj from items c order by c.obj.object_owner,{:random_seed:}]'; @@ -89,7 +89,7 @@ create or replace package body ut_suite_cache_manager is begin l_data := ut_annotation_cache_manager.get_cached_objects_list(a_object_owner, 'PACKAGE'); - select i.object_name + select /*+ no_parallel */ i.object_name bulk collect into l_result from ut_suite_cache_package i where not exists ( @@ -172,7 +172,7 @@ create or replace package body ut_suite_cache_manager is 'nls_sort=binary' )desc nulls last, case when c.obj.self_type = 'UT_SUITE_CONTEXT' then - ( select max( x.line_no ) + 1 + ( select /*+ no_parallel */ max( x.line_no ) + 1 from ut_suite_cache x where c.obj.object_owner = x.object_owner and c.obj.object_name = x.object_name @@ -216,18 +216,18 @@ create or replace package body ut_suite_cache_manager is l_procedure_name varchar2(250) := ut_utils.qualified_sql_name(a_procedure_name); begin - select column_value + select /*+ no_parallel */ column_value bulk collect into l_include_tags from table(l_tags) where column_value not like '-%'; - select ltrim(column_value,'-') + select /*+ no_parallel */ ltrim(column_value,'-') bulk collect into l_exclude_tags from table(l_tags) where column_value like '-%'; if a_path is null and a_object_name is not null then - select min(c.path) + select /*+ no_parallel */ min(c.path) into l_path from ut_suite_cache c where c.object_owner = upper(l_object_owner) @@ -258,7 +258,7 @@ create or replace package body ut_suite_cache_manager is function get_schema_parse_time(a_schema_name varchar2) return timestamp result_cache is l_cache_parse_time timestamp; begin - select min(t.parse_time) + select /*+ no_parallel */ min(t.parse_time) into l_cache_parse_time from ut_suite_cache_schema t where object_owner = upper(a_schema_name); @@ -288,7 +288,7 @@ create or replace package body ut_suite_cache_manager is else - select min(parse_time) + select /*+ no_parallel */ min(parse_time) into l_cached_parse_time from ut_suite_cache_package t where t.object_name = l_object_name @@ -296,23 +296,23 @@ create or replace package body ut_suite_cache_manager is if a_parse_time > l_cached_parse_time or l_cached_parse_time is null then - update ut_suite_cache_schema t + update /*+ no_parallel */ ut_suite_cache_schema t set t.parse_time = a_parse_time where object_owner = l_object_owner; if sql%rowcount = 0 then - insert into ut_suite_cache_schema + insert /*+ no_parallel */ into ut_suite_cache_schema (object_owner, parse_time) values (l_object_owner, a_parse_time); end if; - update ut_suite_cache_package t + update /*+ no_parallel */ ut_suite_cache_package t set t.parse_time = a_parse_time where t.object_owner = l_object_owner and t.object_name = l_object_name; if sql%rowcount = 0 then - insert into ut_suite_cache_package + insert /*+ no_parallel */ into ut_suite_cache_package (object_owner, object_name, parse_time) values (l_object_owner, l_object_name, a_parse_time ); end if; @@ -321,7 +321,7 @@ create or replace package body ut_suite_cache_manager is where t.object_owner = l_object_owner and t.object_name = l_object_name; - insert into ut_suite_cache t + insert /*+ no_parallel */ into ut_suite_cache t ( id, self_type, path, object_owner, object_name, name, line_no, parse_time, description, @@ -336,7 +336,7 @@ create or replace package body ut_suite_cache_manager is select treat(value(x) as ut_suite) i from table(a_suite_items) x where x.self_type in( 'UT_SUITE', 'UT_SUITE_CONTEXT' ) ) - select ut_suite_cache_seq.nextval, s.i.self_type as self_type, s.i.path as path, + select /*+ no_parallel */ ut_suite_cache_seq.nextval, s.i.self_type as self_type, s.i.path as path, upper(s.i.object_owner) as object_owner, upper(s.i.object_name) as object_name, upper(s.i.name) as name, s.i.line_no as line_no, s.i.parse_time as parse_time, s.i.description as description, s.i.rollback_type as rollback_type, s.i.disabled_flag as disabled_flag, s.i.warnings as warnings, @@ -347,7 +347,7 @@ create or replace package body ut_suite_cache_manager is null item from suites s; - insert into ut_suite_cache t + insert /*+ no_parallel */ into ut_suite_cache t ( id, self_type, path, object_owner, object_name, name, line_no, parse_time, description, @@ -362,7 +362,7 @@ create or replace package body ut_suite_cache_manager is select treat(value(x) as ut_test) t from table ( a_suite_items ) x where x.self_type in ( 'UT_TEST' ) ) - select ut_suite_cache_seq.nextval, s.t.self_type as self_type, s.t.path as path, + select /*+ no_parallel */ ut_suite_cache_seq.nextval, s.t.self_type as self_type, s.t.path as path, upper(s.t.object_owner) as object_owner, upper(s.t.object_name) as object_name, upper(s.t.name) as name, s.t.line_no as line_no, s.t.parse_time as parse_time, s.t.description as description, s.t.rollback_type as rollback_type, s.t.disabled_flag as disabled_flag, s.t.warnings as warnings, @@ -385,13 +385,13 @@ create or replace package body ut_suite_cache_manager is l_objects := get_missing_cache_objects(a_schema_name); if l_objects is not empty then - delete from ut_suite_cache i + delete /*+ no_parallel */ from ut_suite_cache i where i.object_owner = a_schema_name - and i.object_name in ( select column_value from table (l_objects) ); + and i.object_name in ( select /*+ no_parallel */ column_value from table (l_objects) ); - delete from ut_suite_cache_package i + delete /*+ no_parallel */ from ut_suite_cache_package i where i.object_owner = a_schema_name - and i.object_name in ( select column_value from table (l_objects) ); + and i.object_name in ( select /*+ no_parallel */ column_value from table (l_objects) ); end if; commit; @@ -405,7 +405,7 @@ create or replace package body ut_suite_cache_manager is l_results ut_suite_items_info; begin l_cache_rows := get_cached_suite_rows( a_object_owner => a_object_owner, a_object_name =>a_object_name ); - select ut_suite_item_info( + select /*+ no_parallel */ ut_suite_item_info( c.object_owner, c.object_name, c.name, c.description, c.self_type, c.line_no, c.path, c.disabled_flag, c.tags @@ -421,7 +421,7 @@ create or replace package body ut_suite_cache_manager is ) return ut_object_names is l_results ut_object_names; begin - select ut_object_name( c.object_owner, c.object_name ) + select /*+ no_parallel */ ut_object_name( c.object_owner, c.object_name ) bulk collect into l_results from ut_suite_cache_package c join table ( a_schema_names ) s @@ -437,7 +437,7 @@ create or replace package body ut_suite_cache_manager is l_count integer; begin if a_procedure_name is not null then - select count( 1 ) into l_count from dual + select /*+ no_parallel */ count( 1 ) into l_count from dual where exists( select 1 from ut_suite_cache c @@ -446,7 +446,7 @@ create or replace package body ut_suite_cache_manager is and c.name = a_procedure_name ); elsif a_package_name is not null then - select count( 1 ) into l_count from dual + select /*+ no_parallel */ count( 1 ) into l_count from dual where exists( select 1 from ut_suite_cache c @@ -454,7 +454,7 @@ create or replace package body ut_suite_cache_manager is and c.object_name = a_package_name ); else - select count( 1 ) into l_count from dual + select /*+ no_parallel */ count( 1 ) into l_count from dual where exists( select 1 from ut_suite_cache c diff --git a/source/core/ut_suite_manager.pkb b/source/core/ut_suite_manager.pkb index 603e713ec..60c33f21f 100644 --- a/source/core/ut_suite_manager.pkb +++ b/source/core/ut_suite_manager.pkb @@ -353,10 +353,10 @@ create or replace package body ut_suite_manager is ); if a_skip_all_objects then open l_result for - select c.* from table(l_unfiltered_rows) c; + select /*+ no_parallel */ c.* from table(l_unfiltered_rows) c; else open l_result for - select c.* from table(l_unfiltered_rows) c + select /*+ no_parallel */ c.* from table(l_unfiltered_rows) c where exists ( select 1 from all_objects a @@ -596,12 +596,12 @@ create or replace package body ut_suite_manager is l_all_suite_info := ut_suite_cache_manager.get_cached_suite_info( l_owner_name, l_package_name ); if can_skip_all_objects_scan( l_owner_name ) then open l_result for - select value(c) + select /*+ no_parallel */ value(c) from table(l_all_suite_info) c order by c.object_owner, c.object_name, c.item_line_no; else open l_result for - select value(c) + select /*+ no_parallel */ value(c) from table(l_all_suite_info) c where exists ( select 1 @@ -631,7 +631,7 @@ create or replace package body ut_suite_manager is refresh_cache(l_owner_name); l_item_exists := ut_suite_cache_manager.suite_item_exists( l_owner_name, l_package_name, l_procedure_name ); if not can_skip_all_objects_scan( l_owner_name ) and l_package_name is not null then - select count(1) + select /*+ no_parallel */ count(1) into l_count from dual c where exists diff --git a/source/core/ut_utils.pkb b/source/core/ut_utils.pkb index 69e6c4725..fa7d229aa 100644 --- a/source/core/ut_utils.pkb +++ b/source/core/ut_utils.pkb @@ -350,7 +350,7 @@ create or replace package body ut_utils is function get_utplsql_objects_list return ut_object_names is l_result ut_object_names; begin - select distinct ut_object_name(sys_context('userenv','current_user'), o.object_name) + select /*+ no_parallel */ distinct ut_object_name(sys_context('userenv','current_user'), o.object_name) bulk collect into l_result from user_objects o where o.object_name = 'UT' or object_name like 'UT\_%' escape '\' @@ -532,8 +532,8 @@ create or replace package body ut_utils is procedure flush_lines(a_lines ut_varchar2_rows, a_offset integer) is begin if a_lines is not empty then - insert into ut_dbms_output_cache (seq_no,text) - select rownum+a_offset, column_value + insert /*+ no_parallel */ into ut_dbms_output_cache (seq_no,text) + select /*+ no_parallel */ rownum+a_offset, column_value from table(a_lines); end if; end; @@ -558,7 +558,7 @@ create or replace package body ut_utils is c_lines_limit constant integer := 10000; pragma autonomous_transaction; begin - open l_lines_data for select text from ut_dbms_output_cache order by seq_no; + open l_lines_data for select /*+ no_parallel */ text from ut_dbms_output_cache order by seq_no; loop fetch l_lines_data bulk collect into l_lines limit c_lines_limit; for i in 1 .. l_lines.count loop @@ -646,10 +646,10 @@ create or replace package body ut_utils is function xmlgen_escaped_string(a_string in varchar2) return varchar2 is l_result varchar2(4000) := a_string; - l_sql varchar2(32767) := q'!select q'[!'||a_string||q'!]' as "!'||a_string||'" from dual'; + l_sql varchar2(32767) := q'!select /*+ no_parallel */ q'[!'||a_string||q'!]' as "!'||a_string||'" from dual'; begin if a_string is not null then - select extract(dbms_xmlgen.getxmltype(l_sql),'/*/*/*').getRootElement() + select /*+ no_parallel */ extract(dbms_xmlgen.getxmltype(l_sql),'/*/*/*').getRootElement() into l_result from dual; end if; @@ -753,7 +753,7 @@ create or replace package body ut_utils is l_for_reporters := ut_reporters_info(ut_reporter_info('UT_REPORTER_BASE','N','N','N')); end if; - select /*+ cardinality(f 10) */ + select /*+ no_parallel cardinality(f 10) */ ut_reporter_info( object_name => t.type_name, is_output_reporter => @@ -801,7 +801,7 @@ create or replace package body ut_utils is function build_valid_xml_name(a_preprocessed_name varchar2) return varchar2 is l_post_processed varchar2(4000); begin - for i in (select regexp_substr( a_preprocessed_name ,'(.{1})', 1, level, null, 1 ) AS string_char,level level_no + for i in (select /*+ no_parallel */ regexp_substr( a_preprocessed_name ,'(.{1})', 1, level, null, 1 ) AS string_char,level level_no from dual connect by level <= regexp_count(a_preprocessed_name, '(.{1})')) loop if i.level_no = 1 and regexp_like(i.string_char,gc_invalid_first_xml_char) then diff --git a/source/expectations/data_values/ut_compound_data_helper.pkb b/source/expectations/data_values/ut_compound_data_helper.pkb index 69ba90811..657c02ce3 100644 --- a/source/expectations/data_values/ut_compound_data_helper.pkb +++ b/source/expectations/data_values/ut_compound_data_helper.pkb @@ -61,7 +61,7 @@ create or replace package body ut_compound_data_helper is where x.data_id = :act_guid ) ucd ) - select + select /*+ no_parallel */ a."UT3$_Item#Data" as act_item_data, a."UT3$_Data#Id" act_data_id, e."UT3$_Item#Data" as exp_item_data, @@ -103,7 +103,7 @@ create or replace package body ut_compound_data_helper is full outer join actual_cols a on e.exp_column_name = a.act_column_name ) - select case + select /*+ no_parallel */ case when exp_col_pos is null and act_col_pos is not null then '+' when exp_col_pos is not null and act_col_pos is null then '-' when exp_col_type_compare != act_col_type_compare then 't' @@ -486,7 +486,7 @@ create or replace package body ut_compound_data_helper is ) unpivot ( data_item for diff_type in (exp_item as 'Expected:', act_item as 'Actual:') ) ) - select rn, diff_type, diffed_row, pk_value + select /*+ no_parallel */ rn, diff_type, diffed_row, pk_value from ( select rn, diff_type, diffed_row, pk_value, case when diff_type = 'Actual:' then 1 else 2 end rnk, @@ -564,7 +564,7 @@ create or replace package body ut_compound_data_helper is procedure insert_diffs_result(a_diff_tab t_diff_tab, a_diff_id raw) is begin forall idx in 1..a_diff_tab.count save exceptions - insert into ut_compound_data_diff_tmp + insert /*+ no_parallel */ into ut_compound_data_diff_tmp ( diff_id, act_item_data, act_data_id, exp_item_data, exp_data_id, item_no, duplicate_no ) values (a_diff_id, @@ -639,13 +639,13 @@ create or replace package body ut_compound_data_helper is procedure save_cursor_data_for_diff(a_data_id raw, a_set_id integer, a_xml xmltype) is begin - insert into ut_compound_data_tmp (data_id, item_no, item_data) values (a_data_id, a_set_id, a_xml); + insert /*+ no_parallel */ into ut_compound_data_tmp (data_id, item_no, item_data) values (a_data_id, a_set_id, a_xml); end; function get_row_data_as_xml(a_data_id raw, a_max_rows integer) return ut_utils.t_clob_tab is l_results ut_utils.t_clob_tab; begin - select xmlserialize( content ucd.item_data no indent) + select /*+ no_parallel */ xmlserialize( content ucd.item_data no indent) bulk collect into l_results from ut_compound_data_tmp tmp ,xmltable ( '/ROWSET' passing tmp.item_data @@ -720,7 +720,7 @@ create or replace package body ut_compound_data_helper is or (a.json_type != e.json_type) or (decode(a.element_value,e.element_value,1,0) = 0) ) - select difference_type, + select /*+ no_parallel */ difference_type, act_element_name, act_element_value, act_json_type, act_access_path, act_parent_path, exp_element_name, exp_element_value, exp_json_type, exp_access_path, exp_parent_path bulk collect into l_result_diff @@ -742,7 +742,7 @@ create or replace package body ut_compound_data_helper is l_diffs tt_json_diff_tab := compare_json_data(a_act_json_data,a_exp_json_data); begin forall i in 1..l_diffs.count - insert into ut_json_data_diff_tmp ( + insert /*+ no_parallel */ into ut_json_data_diff_tmp ( diff_id, difference_type, act_element_name, act_element_value, act_json_type, act_access_path, act_parent_path, exp_element_name, exp_element_value, exp_json_type, exp_access_path, exp_parent_path @@ -759,7 +759,7 @@ create or replace package body ut_compound_data_helper is function get_json_diffs_type(a_diff_id raw) return tt_json_diff_type_tab is l_diffs_summary tt_json_diff_type_tab := tt_json_diff_type_tab(); begin - select d.difference_type,count(1) + select /*+ no_parallel */ d.difference_type,count(1) bulk collect into l_diffs_summary from ut_json_data_diff_tmp d where diff_id = a_diff_id @@ -771,7 +771,7 @@ create or replace package body ut_compound_data_helper is function get_json_diffs_tmp(a_diff_id raw) return tt_json_diff_tab is l_diffs tt_json_diff_tab; begin - select difference_type, + select /*+ no_parallel */ difference_type, act_element_name, act_element_value, act_json_type, act_access_path, act_parent_path, exp_element_name, exp_element_value, exp_json_type, exp_access_path, exp_parent_path bulk collect into l_diffs diff --git a/source/expectations/data_values/ut_cursor_details.tpb b/source/expectations/data_values/ut_cursor_details.tpb index 20313ed96..adc705f65 100644 --- a/source/expectations/data_values/ut_cursor_details.tpb +++ b/source/expectations/data_values/ut_cursor_details.tpb @@ -3,7 +3,7 @@ create or replace type body ut_cursor_details as member function equals( a_other ut_cursor_details, a_match_options ut_matcher_options ) return boolean is l_diffs integer; begin - select count(1) into l_diffs + select /*+ no_parallel */ count(1) into l_diffs from table(self.cursor_columns_info) a full outer join table(a_other.cursor_columns_info) e on decode(a.parent_name,e.parent_name,1,0)= 1 @@ -139,7 +139,7 @@ create or replace type body ut_cursor_details as member function contains_collection return boolean is l_collection_elements number; begin - select count(1) into l_collection_elements + select /*+ no_parallel */ count(1) into l_collection_elements from table(cursor_columns_info) c where c.is_collection = 1 and rownum = 1; return l_collection_elements > 0; @@ -149,7 +149,7 @@ create or replace type body ut_cursor_details as l_result ut_varchar2_list; begin --regexp_replace(c.access_path,'^\/?([^\/]+\/){1}') - select fl.column_value + select /*+ no_parallel */ fl.column_value bulk collect into l_result from table(a_expected_columns) fl where not exists ( @@ -179,7 +179,7 @@ create or replace type body ut_cursor_details as select regexp_replace( column_value, c_xpath_extract_reg, '\5' ) col_names from table(a_match_options.exclude.items) ) - select value(x) + select /*+ no_parallel */ value(x) bulk collect into l_result.cursor_columns_info from table(self.cursor_columns_info) x where exists( @@ -192,7 +192,7 @@ create or replace type body ut_cursor_details as select regexp_replace( column_value, c_xpath_extract_reg, '\5' ) col_names from table(a_match_options.exclude.items) ) - select value(x) + select /*+ no_parallel */ value(x) bulk collect into l_result.cursor_columns_info from table(self.cursor_columns_info) x where not exists( @@ -202,7 +202,7 @@ create or replace type body ut_cursor_details as --Rewrite column order after columns been excluded for i in ( - select parent_name, access_path, display_path, has_nested_col, + select /*+ no_parallel */ parent_name, access_path, display_path, has_nested_col, transformed_name, hierarchy_level, rownum as new_position, xml_valid_name, column_name, column_type, column_type_name, column_schema, @@ -224,7 +224,7 @@ create or replace type body ut_cursor_details as member function get_xml_children(a_parent_name varchar2 := null) return xmltype is l_result xmltype; begin - select xmlagg(xmlelement(evalname t.column_name,t.column_type_name)) + select /*+ no_parallel */ xmlagg(xmlelement(evalname t.column_name,t.column_type_name)) into l_result from table(self.cursor_columns_info) t where (a_parent_name is null and parent_name is null and hierarchy_level = 1 and column_name is not null) @@ -236,7 +236,7 @@ create or replace type body ut_cursor_details as l_root varchar2(250); begin if self.cursor_columns_info.count > 0 then - select x.access_path into l_root from table(self.cursor_columns_info) x + select /*+ no_parallel */ x.access_path into l_root from table(self.cursor_columns_info) x where x.hierarchy_level = 1; else l_root := null; diff --git a/source/expectations/data_values/ut_data_value_anydata.tpb b/source/expectations/data_values/ut_data_value_anydata.tpb index a81b0f5c7..bb52159e0 100644 --- a/source/expectations/data_values/ut_data_value_anydata.tpb +++ b/source/expectations/data_values/ut_data_value_anydata.tpb @@ -48,11 +48,11 @@ create or replace type body ut_data_value_anydata as begin l_status := l_value.get'||self.compound_type||'(l_data); '|| case when self.compound_type = 'collection' then - q'[ open :l_tmp_refcursor for select value(x) as "]'|| + q'[ open :l_tmp_refcursor for select /*+ no_parallel */ value(x) as "]'|| ut_metadata.get_object_name(ut_metadata.get_collection_element(a_data_value))|| q'[" from table(l_data) x;]' else - q'[ open :l_tmp_refcursor for select l_data as "]'||ut_metadata.get_object_name(self.data_type)|| + q'[ open :l_tmp_refcursor for select /*+ no_parallel */ l_data as "]'||ut_metadata.get_object_name(self.data_type)|| q'[" from dual;]' end || 'end;'; diff --git a/source/expectations/data_values/ut_data_value_refcursor.tpb b/source/expectations/data_values/ut_data_value_refcursor.tpb index 801b35802..da5c1a381 100644 --- a/source/expectations/data_values/ut_data_value_refcursor.tpb +++ b/source/expectations/data_values/ut_data_value_refcursor.tpb @@ -178,7 +178,7 @@ create or replace type body ut_data_value_refcursor as l_missing_cols(l_missing_cols.last) := coalesce(a_column_diffs(i).expected_name, a_column_diffs(i).actual_name); end if; end loop; - select value(i) bulk collect into l_result + select /*+ no_parallel */ value(i) bulk collect into l_result from table(a_cursor_details) i where i.access_path not in ( select c.column_value diff --git a/source/reporters/ut_debug_reporter.tpb b/source/reporters/ut_debug_reporter.tpb index 365f77755..5f457bb79 100644 --- a/source/reporters/ut_debug_reporter.tpb +++ b/source/reporters/ut_debug_reporter.tpb @@ -71,7 +71,7 @@ create or replace type body ut_debug_reporter is member function event_item_to_clob(a_event_item ut_event_item) return clob is l_clob clob; begin - select xmlserialize( content deletexml(xmltype(a_event_item),'/*/ITEMS|/*/ALL_EXPECTATIONS|/*/FAILED_EXPECTATIONS') as clob indent size = 2 ) into l_clob from dual; + select /*+ no_parallel */ xmlserialize( content deletexml(xmltype(a_event_item),'/*/ITEMS|/*/ALL_EXPECTATIONS|/*/FAILED_EXPECTATIONS') as clob indent size = 2 ) into l_clob from dual; return l_clob; end;