Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76b2df3

Browse files
authored
Merge branch 'develop' into issue-357
2 parents 2c4ffde + 15a0922 commit 76b2df3

4 files changed

Lines changed: 72 additions & 28 deletions

File tree

.travis/install.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ pwd
88
set feedback off
99
set verify off
1010
11-
@../source/create_utplsql_owner.sql $UT3_OWNER $UT3_OWNER_PASSWORD $UT3_TABLESPACE
11+
--@../source/create_utplsql_owner.sql $UT3_OWNER $UT3_OWNER_PASSWORD $UT3_TABLESPACE
12+
@../source/install_headless.sql
13+
14+
set feedback on
15+
--change the deafult password
16+
alter user $UT3_OWNER identified by $UT3_OWNER_PASSWORD;
1217
--needed for Mystats script to work
1318
grant select any dictionary to $UT3_OWNER;
1419
--Needed for testing a coverage outside ut3_owner.
1520
grant create any procedure, execute any procedure to $UT3_OWNER;
1621
22+
set feedback off
1723
@../source/create_utplsql_owner.sql $UT3_USER $UT3_USER_PASSWORD $UT3_TABLESPACE
1824
1925
cd ..
@@ -23,10 +29,10 @@ cd ..
2329
--@ut_debug_enable.sql
2430
--cd ..
2531
26-
cd source
27-
@install.sql $UT3_OWNER
28-
@create_synonyms_and_grants_for_user.sql $UT3_OWNER $UT3_USER
29-
cd ..
32+
--cd source
33+
--@install.sql $UT3_OWNER
34+
--@create_synonyms_and_grants_for_user.sql $UT3_OWNER $UT3_USER
35+
--cd ..
3036
3137
cd development
3238
conn $UT3_OWNER/$UT3_OWNER_PASSWORD@//$CONNECTION_STR

source/core/coverage/proftab.sql

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
create table plsql_profiler_runs
1+
declare
2+
l_tab_exist number;
3+
begin
4+
select count(*) into l_tab_exist from
5+
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_RUNS' and owner = sys_context('USERENV','CURRENT_SCHEMA')
6+
union all
7+
select synonym_name from all_synonyms where synonym_name = 'PLSQL_PROFILER_RUNS' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
8+
if l_tab_exist = 0 then
9+
execute immediate q'[create table plsql_profiler_runs
210
(
311
runid number primary key, -- unique run identifier,
412
-- from plsql_profiler_runnumber
@@ -11,12 +19,23 @@ create table plsql_profiler_runs
1119
run_system_info varchar2(2047), -- currently unused
1220
run_comment1 varchar2(2047), -- additional comment
1321
spare1 varchar2(256) -- unused
14-
);
22+
)]';
23+
execute immediate q'[comment on table plsql_profiler_runs is
24+
'Run-specific information for the PL/SQL profiler']';
25+
dbms_output.put_line('PLSQL_PROFILER_RUNS table created');
26+
end if;
27+
end;
28+
/
1529

16-
comment on table plsql_profiler_runs is
17-
'Run-specific information for the PL/SQL profiler';
18-
19-
create table plsql_profiler_units
30+
declare
31+
l_tab_exist number;
32+
begin
33+
select count(*) into l_tab_exist from
34+
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_UNITS' and owner = sys_context('USERENV','CURRENT_SCHEMA')
35+
union all
36+
select synonym_name from all_synonyms where synonym_name = 'PLSQL_PROFILER_UNITS' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
37+
if l_tab_exist = 0 then
38+
execute immediate q'[create table plsql_profiler_units
2039
(
2140
runid number references plsql_profiler_runs,
2241
unit_number number, -- internally generated library unit #
@@ -31,12 +50,23 @@ create table plsql_profiler_units
3150
spare2 number, -- unused
3251
--
3352
primary key (runid, unit_number)
34-
);
35-
36-
comment on table plsql_profiler_units is
37-
'Information about each library unit in a run';
53+
)]';
54+
execute immediate q'[comment on table plsql_profiler_units is
55+
'Information about each library unit in a run']';
56+
dbms_output.put_line('PLSQL_PROFILER_UNITS table created');
57+
end if;
58+
end;
59+
/
3860

39-
create table plsql_profiler_data
61+
declare
62+
l_tab_exist number;
63+
begin
64+
select count(*) into l_tab_exist from
65+
(select table_name from all_tables where table_name = 'PLSQL_PROFILER_DATA' and owner = sys_context('USERENV','CURRENT_SCHEMA')
66+
union all
67+
select synonym_name from all_synonyms where synonym_name = 'PLSQL_PROFILER_DATA' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
68+
if l_tab_exist = 0 then
69+
execute immediate q'[create table plsql_profiler_data
4070
(
4171
runid number, -- unique (generated) run identifier
4272
unit_number number, -- internally generated library unit #
@@ -52,10 +82,25 @@ create table plsql_profiler_data
5282
--
5383
primary key (runid, unit_number, line#),
5484
foreign key (runid, unit_number) references plsql_profiler_units
55-
);
56-
57-
comment on table plsql_profiler_data is
58-
'Accumulated data from all profiler runs';
85+
)]';
86+
execute immediate q'[comment on table plsql_profiler_data is
87+
'Accumulated data from all profiler runs']';
88+
dbms_output.put_line('PLSQL_PROFILER_DATA table created');
89+
end if;
90+
end;
91+
/
5992

60-
create sequence plsql_profiler_runnumber start with 1 nocache;
93+
declare
94+
l_seq_exist number;
95+
begin
96+
select count(*) into l_seq_exist from
97+
(select sequence_name from all_sequences where sequence_name = 'PLSQL_PROFILER_RUNNUMBER' and sequence_owner = sys_context('USERENV','CURRENT_SCHEMA')
98+
union all
99+
select synonym_name from all_synonyms where synonym_name = 'PLSQL_PROFILER_RUNNUMBER' and owner = sys_context('USERENV','CURRENT_SCHEMA'));
100+
if l_seq_exist = 0 then
101+
execute immediate q'[create sequence plsql_profiler_runnumber start with 1 nocache]';
102+
dbms_output.put_line('Sequence PLSQL_PROFILER_RUNNUMBER created');
103+
end if;
104+
end;
105+
/
61106

source/install.sql

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,7 @@ alter session set plsql_warnings = 'ENABLE:ALL', 'DISABLE:(5004,5018,6000,6001,6
8787
@@install_component.sql 'core/ut_expectation_processor.pkb'
8888

8989
prompt Installing PLSQL profiler objects into &&ut3_owner schema
90-
prompt You will see "ORA-00955" errors if they already exist
91-
prompt &&line_separator
92-
whenever sqlerror continue
93-
set feedback on
9490
@@core/coverage/proftab.sql
95-
whenever sqlerror exit failure rollback
9691

9792
@@install_component.sql 'core/ut_file_mapper.pks'
9893
@@install_component.sql 'core/ut_file_mapper.pkb'

source/install_headless.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,3 @@ define ut3_tablespace = users
2121
@@create_utplsql_owner.sql &&ut3_owner &&ut3_password &&ut3_tablespace
2222
@@install.sql &&ut3_owner
2323
@@create_synonyms_and_grants_for_public.sql &&ut3_owner
24-
25-
exit

0 commit comments

Comments
 (0)