You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--needed for disabling DDL trigger and testint parser without trigger enabled/present
74
+
grant alter any trigger to ut3_tester;
75
+
grant administer database trigger to $UT3_TESTER;
68
76
exit
69
77
SQL
70
78
@@ -88,5 +96,7 @@ set feedback on
88
96
--Needed for testing coverage outside of main UT3 schema.
89
97
grant create any procedure, drop any procedure, execute any procedure, create any type, drop any type, execute any type, under any type, select any table, update any table, insert any table, delete any table, create any table, drop any table, alter any table, select any dictionary, create any synonym, drop any synonym to $UT3_TESTER_HELPER;
90
98
grant create job to $UT3_TESTER_HELPER;
99
+
--Needed to allow for enable/disable of annotation triggers
100
+
grant administer database trigger to $UT3_TESTER_HELPER;
Copy file name to clipboardExpand all lines: docs/userguide/install.md
+75-9Lines changed: 75 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,16 +72,44 @@ The utPLSQL may be installed on any supported version of Oracle Database [see](h
72
72
* 12c
73
73
* 12c R2
74
74
* 18c
75
+
* 19c
75
76
76
77
# Headless installation
77
78
78
-
To install the utPLSQL into a new database schema and grant it to public, execute the script `install_headless.sql` as SYSDBA.
79
+
utPLSQL can be installed with DDL trigger, to enable tracking of DDL changes to your unit test packages.
80
+
This is the recommended installation approach, when you want to compile and run unit test packages in a schema containing huge amount of database packages (for example Oracle EBS installation schema).
81
+
The reason for having DDL trigger is to enable in-time annotation parsing for utPLSQL.
82
+
Without DDL trigger, utPLSQL needs to investigate your schema objects last_ddl_timestamp each time tests are executed to check if any of DB packages were changed in given schema and if they need scanning for annotation changes.
83
+
This process can be time-consuming if DB schema is large.
79
84
80
-
The script accepts three optional parameters that define:
85
+
The headless scripts accept three optional parameters that define:
81
86
- username to create as owner of utPLSQL (default `ut3`)
82
87
- password for owner of utPLSQL (default `XNtxj8eEgA6X6b6f`)
83
88
- tablespace to use for storage of profiler data (default `users`)
84
89
90
+
The scripts need to be executed by `SYSDBA`, in order to grant access to `DBMS_LOCK` and `DBMS_CRYPTO` system packages.
91
+
92
+
**Note:**
93
+
> Grant on `DBMS_LOCK` is required only for installation on Oracle versions below 18c. For versions 18c and above, utPLSQL uses `DBMS_SESSION.SLEEP` so access to `DBMS_LOCK` package is no longer needed.
94
+
95
+
**Note:**
96
+
> The user performing the installation must have the `ADMINISTER DATABASE TRIGGER` privilege. This is required for installation of trigger that is responsible for parsing annotations at at compile-time of a package.
97
+
98
+
**Note:**
99
+
> When installing with DDL trigger, utPLSQL will not be registering unit tests for any of oracle-maintained schemas.
> For Oracle 12c and above the users returned by below query are excluded by utPLSQL:
104
+
>
105
+
>```sql
106
+
>select username from all_users where oracle_maintained='Y';
107
+
>```
108
+
109
+
## Installation without DDL trigger
110
+
111
+
To install the utPLSQL into a new database schema and grant it to public, execute the script `install_headless.sql` as SYSDBA.
112
+
85
113
Example invocation of the script from command line:
86
114
```bash
87
115
cd source
@@ -94,16 +122,34 @@ cd source
94
122
sqlplus sys/sys_pass@db as sysdba @install_headless.sql utp3 my_verySecret_password utp3_tablespace
95
123
```
96
124
97
-
The script needs to be executed by `SYSDBA`, in order to grant access to `DBMS_LOCK` and `DBMS_CRYPTO` system packages.
125
+
## Installation with DDL trigger
126
+
127
+
To install the utPLSQL into a new database schema and grant it to public, execute the script `install_headless_with_trigger.sql` as SYSDBA.
128
+
129
+
Example invocation of the script from command line:
130
+
```bash
131
+
cdsource
132
+
sqlplus sys/sys_pass@db as sysdba @install_headless_with_trigger.sql
133
+
```
98
134
99
-
*Note:* Grant on `DBMS_LOCK` is required on Oracle versions below 18c
135
+
Invoking script with parameters:
136
+
```bash
137
+
cdsource
138
+
sqlplus sys/sys_pass@db as sysdba @install_headless_with_trigger.sql utp3 my_verySecret_password utp3_tablespace
139
+
```
100
140
141
+
**Note:**
142
+
>When installing utPLSQL into database with existing unit test packages, utPLSQL will not be able to already-existing unit test packages. When utPSLQL was installed with DDL trigger, you have to do one of:
143
+
>- Recompile existing Unit Test packages to make utPLSQL aware of their existence
144
+
>- Invoke `exec ut_runner.rebuild_annotation_cache(a_schema_name=> ... );` for every schema containing unit tests in your database
145
+
>
146
+
> Steps above are required to assure annotation cache is populated properly from existing objects. Rebuilding annotation cache might be faster than code recompilation.
101
147
102
148
# Recommended Schema
103
149
It is highly recommended to install utPLSQL in it's own schema. You are free to choose any name for this schema.
104
150
Installing uPLSQL into shared schema is really not recommended as you loose isolation of framework.
105
151
106
-
If the installation and utPLSQL owner user is one and the same, the user must have the following Oracle system permissions before you can proceed with the installation.
152
+
If the installing user and utPLSQL owner is one and the same, the user must have the following Oracle system permissions before you can proceed with the installation.
107
153
108
154
- CREATE SESSION
109
155
- CREATE PROCEDURE
@@ -113,6 +159,7 @@ If the installation and utPLSQL owner user is one and the same, the user must ha
113
159
- CREATE VIEW
114
160
- CREATE SYNONYM
115
161
- ALTER SESSION
162
+
- CREATE TRIGGER
116
163
117
164
In addition the user must be granted the execute privilege on `DBMS_LOCK` and `DBMS_CRYPTO` packages.
118
165
@@ -123,7 +170,7 @@ It is up to DBA to maintain the storage of the profiler tables.
123
170
124
171
# Manual installation procedure
125
172
126
-
###Creating schema for utPLSQL
173
+
## Creating schema for utPLSQL
127
174
To create the utPLSQL schema and grant all the required privileges execute script `create_utplsql_owner.sql` from the `source` directory with parameters:
128
175
129
176
-`user name` - the name of the user that will own of utPLSQL object
@@ -136,8 +183,8 @@ cd source
136
183
sqlplus sys/sys_password@database as sysdba @create_utPLSQL_owner.sql ut3 ut3 users
137
184
```
138
185
139
-
###Installing utPLSQL
140
-
To install the utPLSQL framework into your databaserun the `/source/install.sql`script and provide `schema_name`where utPLSQL is to be installed.
186
+
## Installing utPLSQL
187
+
To install the utPLSQL framework into your database, go to `source` directory, run the `install.sql`providing the `schema_name`for utPLSQL as parameter.
141
188
Schema must be created prior to calling the `install` script.
142
189
You may install utPLSQL from any account that has sufficient privileges to create objects in other users schema.
### Allowing other users to access the utPLSQL framework
197
+
## Installing DDL trigger
198
+
To minimize startup time of utPLSQL framework (especially on a database with large schema) it is recommended to install utPLSQL DDL trigger to enable utPLSQL annotation to be updated at compile-time.
199
+
200
+
It's recommended to install DDL trigger when connected as `SYSDBA` user. Trigger is created in utPLSQL schema.
201
+
If using the owner schema of utPLSQL to install trigger, the owner needs to have `ADMINISTER DATABASE TRIGGER` and `CREATE TRIGGER` system privileges.
202
+
If using different user to install trigger, the user needs to have `ADMINISTER DATABASE TRIGGER` and `CREATE ANY TRIGGER` system privileges.
203
+
204
+
To install DDL trigger go to `source` directory, run the `install_ddl_trigger.sql` providing the `schema_name` for utPLSQL as parameter.
0 commit comments