1- create global temporary table plsql_profiler_runs(
1+ create global temporary table plsql_profiler_runs$ (
22 /*
33 utPLSQL - Version X.X.X.X
44 Copyright 2016 - 2017 utPLSQL Project
@@ -25,10 +25,56 @@ create global temporary table plsql_profiler_runs(
2525 spare1 varchar2 (256 ) -- unused
2626) on commit preserve rows;
2727
28- comment on table plsql_profiler_runs is
28+ comment on table plsql_profiler_runs$ is
2929 ' Run-specific information for the PL/SQL profiler' ;
3030
31- create global temporary table plsql_profiler_units(
31+ declare
32+ ex_nonedition_user exception;
33+ ex_view_doesnt_exist exception;
34+ pragma exception_init(ex_nonedition_user,- 42314 );
35+ pragma exception_init(ex_view_doesnt_exist,- 942 );
36+ v_view_source varchar2 (32767 );
37+ begin
38+ begin
39+ execute immediate ' drop view plsql_profiler_runs' ;
40+ exception
41+ when ex_view_doesnt_exist then
42+ null ;
43+ end;
44+ v_view_source := ' plsql_profiler_runs as
45+ /*
46+ utPLSQL - Version X.X.X.X
47+ Copyright 2016 - 2017 utPLSQL Project
48+ Licensed under the Apache License, Version 2.0 (the "License"):
49+ you may not use this file except in compliance with the License.
50+ You may obtain a copy of the License at
51+ http://www.apache.org/licenses/LICENSE-2.0
52+ Unless required by applicable law or agreed to in writing, software
53+ distributed under the License is distributed on an "AS IS" BASIS,
54+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
55+ See the License for the specific language governing permissions and
56+ limitations under the License.
57+ */
58+ select runid
59+ ,related_run
60+ ,run_owner
61+ ,run_date
62+ ,run_comment
63+ ,run_total_time
64+ ,run_system_info
65+ ,run_comment1
66+ ,spare1
67+ from plsql_profiler_runs$' ;
68+
69+ execute immediate ' create or replace editioning view ' || v_view_source;
70+ exception
71+ when ex_nonedition_user then
72+ execute immediate ' create or replace view ' || v_view_source;
73+ end;
74+ /
75+
76+
77+ create global temporary table plsql_profiler_units$(
3278 /*
3379 utPLSQL - Version X.X.X.X
3480 Copyright 2016 - 2017 utPLSQL Project
@@ -57,10 +103,55 @@ create global temporary table plsql_profiler_units(
57103 primary key (runid, unit_number)
58104) on commit preserve rows;
59105
60- comment on table plsql_profiler_units is
106+ comment on table plsql_profiler_units$ is
61107 ' Information about each library unit in a run' ;
62108
63- create global temporary table plsql_profiler_data(
109+ declare
110+ ex_nonedition_user exception;
111+ ex_view_doesnt_exist exception;
112+ pragma exception_init(ex_nonedition_user,- 42314 );
113+ pragma exception_init(ex_view_doesnt_exist,- 942 );
114+ v_view_source varchar2 (32767 );
115+ begin
116+ begin
117+ execute immediate ' drop view plsql_profiler_units' ;
118+ exception
119+ when ex_view_doesnt_exist then
120+ null ;
121+ end;
122+ v_view_source := ' plsql_profiler_units as
123+ /*
124+ utPLSQL - Version X.X.X.X
125+ Copyright 2016 - 2017 utPLSQL Project
126+ Licensed under the Apache License, Version 2.0 (the "License"):
127+ you may not use this file except in compliance with the License.
128+ You may obtain a copy of the License at
129+ http://www.apache.org/licenses/LICENSE-2.0
130+ Unless required by applicable law or agreed to in writing, software
131+ distributed under the License is distributed on an "AS IS" BASIS,
132+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133+ See the License for the specific language governing permissions and
134+ limitations under the License.
135+ */
136+ select runid
137+ ,unit_number
138+ ,unit_type
139+ ,unit_owner
140+ ,unit_name
141+ ,unit_timestamp
142+ ,total_time
143+ ,spare1
144+ ,spare2
145+ from plsql_profiler_units$' ;
146+
147+ execute immediate ' create or replace editioning view ' || v_view_source;
148+ exception
149+ when ex_nonedition_user then
150+ execute immediate ' create or replace view ' || v_view_source;
151+ end;
152+ /
153+
154+ create global temporary table plsql_profiler_data$(
64155 /*
65156 utPLSQL - Version X.X.X.X
66157 Copyright 2016 - 2017 utPLSQL Project
@@ -89,7 +180,54 @@ create global temporary table plsql_profiler_data(
89180 primary key (runid, unit_number, line # )
90181) on commit preserve rows;
91182
92- comment on table plsql_profiler_data is
183+ comment on table plsql_profiler_data$ is
93184 ' Accumulated data from all profiler runs' ;
94185
95186create sequence plsql_profiler_runnumber start with 1 nocache;
187+
188+ declare
189+ ex_nonedition_user exception;
190+ ex_view_doesnt_exist exception;
191+ pragma exception_init(ex_nonedition_user,- 42314 );
192+ pragma exception_init(ex_view_doesnt_exist,- 942 );
193+ v_view_source varchar2 (32767 );
194+ begin
195+ begin
196+ execute immediate ' drop view plsql_profiler_data' ;
197+ exception
198+ when ex_view_doesnt_exist then
199+ null ;
200+ end;
201+ v_view_source := ' plsql_profiler_data as
202+ /*
203+ utPLSQL - Version X.X.X.X
204+ Copyright 2016 - 2017 utPLSQL Project
205+ Licensed under the Apache License, Version 2.0 (the "License"):
206+ you may not use this file except in compliance with the License.
207+ You may obtain a copy of the License at
208+ http://www.apache.org/licenses/LICENSE-2.0
209+ Unless required by applicable law or agreed to in writing, software
210+ distributed under the License is distributed on an "AS IS" BASIS,
211+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
212+ See the License for the specific language governing permissions and
213+ limitations under the License.
214+ */
215+ select runid
216+ ,unit_number
217+ ,line#
218+ ,total_occur
219+ ,total_time
220+ ,min_time
221+ ,max_time
222+ ,spare1
223+ ,spare2
224+ ,spare3
225+ ,spare4
226+ from plsql_profiler_data$' ;
227+
228+ execute immediate ' create or replace editioning view ' || v_view_source;
229+ exception
230+ when ex_nonedition_user then
231+ execute immediate ' create or replace view ' || v_view_source;
232+ end;
233+ /
0 commit comments