-
Notifications
You must be signed in to change notification settings - Fork 189
Improved installation routine #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
7d89f1c
7d6b4b8
4dbf6e8
3bd33d1
f4fd702
d0dbccb
1d71dd0
a8a0093
766af11
f97db36
5605837
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,12 @@ | ||
| create table plsql_profiler_runs | ||
| declare | ||
| l_tab_exist number; | ||
| begin | ||
| select count(*) into l_tab_exist from | ||
| (select table_name from all_tables where table_name = 'PLSQL_PROFILER_RUNS' and owner in (user,'PUBLIC') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot have any table with owner = 'PUBLIC' |
||
| union all | ||
| select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNS'); | ||
| if l_tab_exist = 0 then | ||
| execute immediate q'[create table plsql_profiler_runs | ||
| ( | ||
| runid number primary key, -- unique run identifier, | ||
| -- from plsql_profiler_runnumber | ||
|
|
@@ -11,12 +19,23 @@ create table plsql_profiler_runs | |
| run_system_info varchar2(2047), -- currently unused | ||
| run_comment1 varchar2(2047), -- additional comment | ||
| spare1 varchar2(256) -- unused | ||
| ); | ||
| )]'; | ||
| execute immediate q'[comment on table plsql_profiler_runs is | ||
| 'Run-specific information for the PL/SQL profiler']'; | ||
| dbms_output.put_line('PLSQL_PROFILER_RUNS table created'); | ||
| end if; | ||
| end; | ||
| / | ||
|
|
||
| comment on table plsql_profiler_runs is | ||
| 'Run-specific information for the PL/SQL profiler'; | ||
|
|
||
| create table plsql_profiler_units | ||
| declare | ||
| l_tab_exist number; | ||
| begin | ||
| select count(*) into l_tab_exist from | ||
| (select table_name from all_tables where table_name = 'PLSQL_PROFILER_UNITS' and owner in (user,'PUBLIC') | ||
| union all | ||
| select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_UNITS'); | ||
| if l_tab_exist = 0 then | ||
| execute immediate q'[create table plsql_profiler_units | ||
| ( | ||
| runid number references plsql_profiler_runs, | ||
| unit_number number, -- internally generated library unit # | ||
|
|
@@ -31,12 +50,23 @@ create table plsql_profiler_units | |
| spare2 number, -- unused | ||
| -- | ||
| primary key (runid, unit_number) | ||
| ); | ||
|
|
||
| comment on table plsql_profiler_units is | ||
| 'Information about each library unit in a run'; | ||
| )]'; | ||
| execute immediate q'[comment on table plsql_profiler_units is | ||
| 'Information about each library unit in a run']'; | ||
| dbms_output.put_line('PLSQL_PROFILER_UNITS table created'); | ||
| end if; | ||
| end; | ||
| / | ||
|
|
||
| create table plsql_profiler_data | ||
| declare | ||
| l_tab_exist number; | ||
| begin | ||
| select count(*) into l_tab_exist from | ||
| (select table_name from all_tables where table_name = 'PLSQL_PROFILER_DATA' and owner in (user,'PUBLIC'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| union all | ||
| select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_DATA'); | ||
| if l_tab_exist = 0 then | ||
| execute immediate q'[create table plsql_profiler_data | ||
| ( | ||
| runid number, -- unique (generated) run identifier | ||
| unit_number number, -- internally generated library unit # | ||
|
|
@@ -52,10 +82,25 @@ create table plsql_profiler_data | |
| -- | ||
| primary key (runid, unit_number, line#), | ||
| foreign key (runid, unit_number) references plsql_profiler_units | ||
| ); | ||
|
|
||
| comment on table plsql_profiler_data is | ||
| 'Accumulated data from all profiler runs'; | ||
| )]'; | ||
| execute immediate q'[comment on table plsql_profiler_data is | ||
| 'Accumulated data from all profiler runs']'; | ||
| dbms_output.put_line('PLSQL_PROFILER_DATA table created'); | ||
| end if; | ||
| end; | ||
| / | ||
|
|
||
| create sequence plsql_profiler_runnumber start with 1 nocache; | ||
| declare | ||
| l_seq_exist number; | ||
| begin | ||
| select count(*) into l_seq_exist from | ||
| (select sequence_name from all_sequences where sequence_name = 'PLSQL_PROFILER_RUNNUMBER' and sequence_owner in (user,'PUBLIC'); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| union all | ||
| select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNNUMBER'); | ||
| if l_seq_exist = 0 then | ||
| execute immediate q'[create sequence plsql_profiler_runnumber start with 1 nocache]'; | ||
| dbms_output.put_line('Sequence PLSQL_PROFILER_RUNNUMBER created'); | ||
| end if; | ||
| end; | ||
| / | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still thinking if we should make scripts rerunable or drop objects on uninstall.
Also, since we modify script provided from Oracle, should we split it into one script per object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't drop it. Could you explain why do you want to split it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use a pattern of one script for one object so this script is the only one breaking the pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but its an oracle object, not our... But I can fix it tonight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, lets leave it as it is