1- create table plsql_profiler_runs
1+ declare
2+ l_tab_exist number ;
3+ begin
4+ select count (* ) into l_tab_exist from user_tables where table_name = ' PLSQL_PROFILER_RUNS' ;
5+ if l_tab_exist = 0 then
6+ execute immediate q' [create table plsql_profiler_runs
27(
38 runid number primary key, -- unique run identifier,
49 -- from plsql_profiler_runnumber
@@ -11,12 +16,20 @@ create table plsql_profiler_runs
1116 run_system_info varchar2(2047), -- currently unused
1217 run_comment1 varchar2(2047), -- additional comment
1318 spare1 varchar2(256) -- unused
14- );
19+ )]' ;
20+ execute immediate q' [comment on table plsql_profiler_runs is
21+ ' Run- specific information for the PL/ SQL profiler' ]' ;
22+ dbms_output .put_line (' PLSQL_PROFILER_RUNS table created' );
23+ end if;
24+ end;
25+ /
1526
16- comment on table plsql_profiler_runs is
17- ' Run-specific information for the PL/SQL profiler' ;
18-
19- create table plsql_profiler_units
27+ declare
28+ l_tab_exist number ;
29+ begin
30+ select count (* ) into l_tab_exist from user_tables where table_name = ' PLSQL_PROFILER_UNITS' ;
31+ if l_tab_exist = 0 then
32+ execute immediate q' [create table plsql_profiler_units
2033(
2134 runid number references plsql_profiler_runs,
2235 unit_number number, -- internally generated library unit #
@@ -31,12 +44,20 @@ create table plsql_profiler_units
3144 spare2 number, -- unused
3245 --
3346 primary key (runid, unit_number)
34- );
35-
36- comment on table plsql_profiler_units is
37- ' Information about each library unit in a run' ;
47+ )]' ;
48+ execute immediate q' [comment on table plsql_profiler_units is
49+ ' Information about each library unit in a run' ]' ;
50+ dbms_output .put_line (' PLSQL_PROFILER_UNITS table created' );
51+ end if;
52+ end;
53+ /
3854
39- create table plsql_profiler_data
55+ declare
56+ l_tab_exist number ;
57+ begin
58+ select count (* ) into l_tab_exist from user_tables where table_name = ' PLSQL_PROFILER_DATA' ;
59+ if l_tab_exist = 0 then
60+ execute immediate q' [create table plsql_profiler_data
4061(
4162 runid number, -- unique (generated) run identifier
4263 unit_number number, -- internally generated library unit #
@@ -52,10 +73,22 @@ create table plsql_profiler_data
5273 --
5374 primary key (runid, unit_number, line#),
5475 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' ;
76+ )]' ;
77+ execute immediate q' [comment on table plsql_profiler_data is
78+ ' Accumulated data from all profiler runs' ]' ;
79+ dbms_output .put_line (' PLSQL_PROFILER_DATA table created' );
80+ end if;
81+ end;
82+ /
5983
60- create sequence plsql_profiler_runnumber start with 1 nocache;
84+ declare
85+ l_seq_exist number ;
86+ begin
87+ select count (* ) into l_seq_exist from user_sequences where sequence_name = ' PLSQL_PROFILER_RUNNUMBER' ;
88+ if l_seq_exist = 0 then
89+ execute immediate q' [create sequence plsql_profiler_runnumber start with 1 nocache]' ;
90+ dbms_output .put_line (' Sequence PLSQL_PROFILER_RUNNUMBER created' );
91+ end if;
92+ end;
93+ /
6194
0 commit comments