@@ -19,158 +19,3 @@ set verify off
1919alter session set plsql_optimize_level=0;
2020@${INSTALL_FILE} $UT3_DEVELOP_SCHEMA $UT3_DEVELOP_SCHEMA_PASSWORD
2121SQL
22-
23- if [[ " ${MATRIX_JOB_ID} " == 1 ]]; then
24-
25- # check code-style for errors
26- time " $SQLCLI " $UT3_DEVELOP_SCHEMA /$UT3_DEVELOP_SCHEMA_PASSWORD @//$CONNECTION_STR @../development/utplsql_style_check.sql
27-
28- # test install/uninstall process
29- time " $SQLCLI " sys/$ORACLE_PWD @//$CONNECTION_STR AS SYSDBA << -SQL
30- set feedback off
31- set verify off
32- whenever sqlerror exit failure rollback
33-
34- @uninstall_all.sql $UT3_DEVELOP_SCHEMA
35- whenever sqlerror exit failure rollback
36- declare
37- v_leftover_objects_count integer;
38- begin
39- select sum(cnt)
40- into v_leftover_objects_count
41- from (
42- select count(1) cnt from dba_objects where owner = '$UT3_DEVELOP_SCHEMA '
43- where object_name not like 'PLSQL_PROFILER%' and object_name not like 'DBMSPCC_%'
44- union all
45- select count(1) cnt from dba_synonyms where table_owner = '$UT3_DEVELOP_SCHEMA '
46- where table_name not like 'PLSQL_PROFILER%' and table_name not like 'DBMSPCC_%'
47- );
48- if v_leftover_objects_count > 0 then
49- raise_application_error(-20000, 'Not all objects were successfully uninstalled - leftover objects count='||v_leftover_objects_count);
50- end if;
51- end;
52- /
53- SQL
54-
55- time " $SQLCLI " sys/$ORACLE_PWD @//$CONNECTION_STR AS SYSDBA << -SQL
56- set feedback off
57- set verify off
58-
59- alter session set plsql_optimize_level=0;
60- @install.sql $UT3_DEVELOP_SCHEMA
61- @install_ddl_trigger.sql $UT3_DEVELOP_SCHEMA
62- @create_synonyms_and_grants_for_public.sql $UT3_DEVELOP_SCHEMA
63- SQL
64-
65- fi
66-
67-
68- time " $SQLCLI " sys/$ORACLE_PWD @//$CONNECTION_STR AS SYSDBA << -SQL
69- set feedback off
70- whenever sqlerror exit failure rollback
71-
72- --------------------------------------------------------------------------------
73- PROMPT Adding back create-trigger privilege to $UT3_DEVELOP_SCHEMA for testing
74- grant administer database trigger to $UT3_DEVELOP_SCHEMA ;
75-
76- --------------------------------------------------------------------------------
77- PROMPT Creating $UT3_TESTER - Power-user for testing internal framework code
78-
79- create user $UT3_TESTER identified by "$UT3_TESTER_PASSWORD " default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE ;
80- grant create session, create procedure, create type, create table to $UT3_TESTER ;
81-
82- grant execute on dbms_lock to $UT3_TESTER ;
83-
84- PROMPT Granting $UT3_DEVELOP_SCHEMA code to $UT3_TESTER
85-
86- begin
87- for i in (
88- select object_name from all_objects t
89- where t.object_type in ('PACKAGE','TYPE')
90- and owner = '$UT3_DEVELOP_SCHEMA '
91- and generated = 'N'
92- and object_name not like 'SYS%')
93- loop
94- execute immediate 'grant execute on $UT3_DEVELOP_SCHEMA ."'||i.object_name||'" to $UT3_TESTER ';
95- end loop;
96- end;
97- /
98-
99- PROMPT Granting $UT3_DEVELOP_SCHEMA tables to $UT3_TESTER
100-
101- begin
102- for i in ( select table_name from all_tables t where owner = '$UT3_DEVELOP_SCHEMA ' and nested = 'NO' and iot_name is null)
103- loop
104- execute immediate 'grant select on $UT3_DEVELOP_SCHEMA .'||i.table_name||' to $UT3_TESTER ';
105- end loop;
106- end;
107- /
108-
109-
110- --------------------------------------------------------------------------------
111- PROMPT Creating $UT3_USER - minimal privileges user for API testing
112-
113- create user $UT3_USER identified by "$UT3_USER_PASSWORD " default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE ;
114- grant create session, create procedure, create type, create table to $UT3_USER ;
115-
116- PROMPT Grants for starting a debugging session from $UT3_USER
117- grant debug connect session to $UT3_USER ;
118- grant debug any procedure to $UT3_USER ;
119- begin
120- \$ if dbms_db_version.version <= 11 \$ then
121- null; -- no addition action necessary
122- \$ else
123- -- necessary on 12c or higher
124- dbms_network_acl_admin.append_host_ace (
125- host =>'*',
126- ace => sys.xs\$ ace_type(
127- privilege_list => sys.xs\$ name_list('JDWP') ,
128- principal_name => '$UT3_USER ',
129- principal_type => sys.xs_acl.ptype_db
130- )
131- );
132- \$ end
133- end;
134- /
135-
136- --------------------------------------------------------------------------------
137- PROMPT Creating $UT3_TESTER_HELPER - provides functions to allow min grant test user setup tests.
138-
139- create user $UT3_TESTER_HELPER identified by "$UT3_TESTER_HELPER_PASSWORD " default tablespace $UT3_TABLESPACE quota unlimited on $UT3_TABLESPACE ;
140- grant create session, create procedure, create type, create table to $UT3_TESTER_HELPER ;
141-
142- PROMPT Grants for testing distributed transactions
143- grant create public database link to $UT3_TESTER_HELPER ;
144- grant drop public database link to $UT3_TESTER_HELPER ;
145-
146- PROMPT Grants for testing coverage outside of main $UT3_DEVELOP_SCHEMA schema.
147- grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type,
148- select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table,
149- select any dictionary, create any synonym, drop any synonym,
150- grant any object privilege, grant any privilege, create public synonym, drop public synonym, create any trigger
151- to $UT3_TESTER_HELPER ;
152-
153- grant create job to $UT3_TESTER_HELPER ;
154-
155- PROMPT Additional grants for disabling DDL trigger and testing parser without trigger enabled/present
156-
157- grant alter any trigger to $UT3_TESTER_HELPER ;
158- grant administer database trigger to $UT3_TESTER_HELPER ;
159- grant execute on dbms_lock to $UT3_TESTER_HELPER ;
160-
161- create user ut3_cache_test_owner identified by ut3;
162- grant create session, create procedure to ut3_cache_test_owner;
163-
164- create user ut3_no_extra_priv_user identified by ut3;
165- grant create session, create procedure to ut3_no_extra_priv_user;
166-
167- create user ut3_select_catalog_user identified by ut3;
168- grant create session, create procedure, select_catalog_role to ut3_select_catalog_user;
169-
170- create user ut3_select_any_table_user identified by ut3;
171- grant create session, create procedure, select any table to ut3_select_any_table_user;
172-
173- create user ut3_execute_any_proc_user identified by ut3;
174- grant create session, create procedure, execute any procedure to ut3_execute_any_proc_user;
175- exit
176- SQL
0 commit comments