|
1 | 1 | declare |
2 | 2 | l_tab_exist number; |
3 | 3 | begin |
4 | | - select count(*) into l_tab_exist from user_tables where table_name = 'PLSQL_PROFILER_RUNS'; |
| 4 | + select count(*) into l_tab_exist from |
| 5 | + (select table_name from all_tables where table_name = 'PLSQL_PROFILER_RUNS' and owner in (user,'PUBLIC') |
| 6 | + union all |
| 7 | + select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNS'); |
5 | 8 | if l_tab_exist = 0 then |
6 | 9 | execute immediate q'[create table plsql_profiler_runs |
7 | 10 | ( |
|
27 | 30 | declare |
28 | 31 | l_tab_exist number; |
29 | 32 | begin |
30 | | - select count(*) into l_tab_exist from user_tables where table_name = 'PLSQL_PROFILER_UNITS'; |
| 33 | + select count(*) into l_tab_exist from |
| 34 | + (select table_name from all_tables where table_name = 'PLSQL_PROFILER_UNITS' and owner in (user,'PUBLIC') |
| 35 | + union all |
| 36 | + select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_UNITS'); |
31 | 37 | if l_tab_exist = 0 then |
32 | 38 | execute immediate q'[create table plsql_profiler_units |
33 | 39 | ( |
|
55 | 61 | declare |
56 | 62 | l_tab_exist number; |
57 | 63 | begin |
58 | | - select count(*) into l_tab_exist from user_tables where table_name = 'PLSQL_PROFILER_DATA'; |
| 64 | + select count(*) into l_tab_exist from |
| 65 | + (select table_name from all_tables where table_name = 'PLSQL_PROFILER_DATA' and owner in (user,'PUBLIC'); |
| 66 | + union all |
| 67 | + select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_DATA'); |
59 | 68 | if l_tab_exist = 0 then |
60 | 69 | execute immediate q'[create table plsql_profiler_data |
61 | 70 | ( |
|
84 | 93 | declare |
85 | 94 | l_seq_exist number; |
86 | 95 | begin |
87 | | - select count(*) into l_seq_exist from user_sequences where sequence_name = 'PLSQL_PROFILER_RUNNUMBER'; |
| 96 | + select count(*) into l_seq_exist from |
| 97 | + (select sequence_name from all_sequences where sequence_name = 'PLSQL_PROFILER_RUNNUMBER' and sequence_owner in (user,'PUBLIC'); |
| 98 | + union all |
| 99 | + select synonym_name from user_synonyms where synonym_name = 'PLSQL_PROFILER_RUNNUMBER'); |
88 | 100 | if l_seq_exist = 0 then |
89 | 101 | execute immediate q'[create sequence plsql_profiler_runnumber start with 1 nocache]'; |
90 | 102 | dbms_output.put_line('Sequence PLSQL_PROFILER_RUNNUMBER created'); |
|
0 commit comments