-
Notifications
You must be signed in to change notification settings - Fork 0
Database requirements
Grants and configurations required on the Oracle database to use the extension with all features.
| Oracle | utPLSQL | Character set | Notes |
|---|---|---|---|
| 18c+ | v3.2.x / v3.1.x | AL32UTF8 |
Recommended. |
| 12.2 | v3.1.x only | prefer AL32UTF8
|
v3.2.x fails to compile (PLS-00222). Legacy WE8DEC loses non-representable chars. |
The thin driver uses always
AL32UTF8and ignoresNLS_LANG; the server converts to the database character set. On aWE8DECdatabase,€becomes¿and the extension cannot fix it client-side.
Enables the profiler for the schema that runs the tests:
GRANT EXECUTE ON SYS.DBMS_PROFILER TO <schema_that_runs_the_tests>;
GRANT EXECUTE ON SYS.DBMS_PLSQL_CODE_COVERAGE TO <schema_that_runs_the_tests>;Without these grants, tests will run but coverage will come back empty (0%).
Keep both grants: coverage uses
DBMS_PROFILERand, on Oracle 19c+, alsoDBMS_PLSQL_CODE_COVERAGE. TheCopy coverage grants to clipboardcommand copies both statements.
When utPLSQL is installed in shared mode (owner UT3 with tests in
separate application schemas), the utPLSQL owner needs to read the
dictionary of the application schemas:
GRANT SELECT ON SYS.DBA_SOURCE TO <ut3_owner>;
GRANT SELECT ON SYS.DBA_OBJECTS TO <ut3_owner>;
GRANT SELECT ON SYS.DBA_PROCEDURES TO <ut3_owner>;Important:
-
SELECT ANY DICTIONARYalone is NOT enough — direct grants on these views are required (due todbms_assert.sql_object_namein definer context). - The utPLSQL DDL trigger must also be installed (keeps the annotation cache up to date after code changes).
Verification (as the owner):
SELECT ut_metadata.get_source_view_name FROM dual;
-- should return: dba_source
Owner UT3 receives SELECT ON DBA_SOURCE/OBJECTS/PROCEDURES grants to read
annotations in application schemas (DEV, TEST, ...).
utPLSQL installed in the same schema as the tests — no cross-schema grants.
In per-schema installs,
DBA_SOURCE/DBA_OBJECTS/DBA_PROCEDURESgrants are not required — the framework reads its own source.
To debug tests (Debug Adapter utplsql), the schema that runs the tests needs:
GRANT DEBUG CONNECT SESSION TO <schema_that_runs_the_tests>;
GRANT EXECUTE ON SYS.DBMS_DEBUG TO <schema_that_runs_the_tests>;The target package must also be compiled with debug information: Oracle
strips it at PLSQL_OPTIMIZE_LEVEL = 2 (the default). Compile with
PLSQL_OPTIMIZE_LEVEL <= 1 (or ALTER PACKAGE <pkg> COMPILE DEBUG PLSQL_OPTIMIZE_LEVEL = 1, or use the utPLSQL: Compile for Debug
command), otherwise breakpoints are silently ignored.
ALTER ... COMPILE DEBUGalone only setsPLSQL_DEBUGand keeps the optimizer level — it must be combined withPLSQL_OPTIMIZE_LEVEL = 1.
Run this script as DBA to audit the configuration:
-- 1. Check if utPLSQL is installed
SELECT ut_meta.version() FROM dual;
-- 2. Check profiler grants (coverage)
SELECT grantee, table_name, privilege
FROM dba_tab_privs
WHERE table_name IN ('DBMS_PROFILER', 'DBMS_PLSQL_CODE_COVERAGE')
AND grantee IN ('UT3', 'DEV', 'TEST');
-- 3. Check dictionary grants (cross-schema discovery)
SELECT grantee, table_name, privilege
FROM dba_tab_privs
WHERE table_name IN ('DBA_SOURCE', 'DBA_OBJECTS', 'DBA_PROCEDURES')
AND grantee = 'UT3';
-- 4. Check utPLSQL source view
SELECT ut_metadata.get_source_view_name FROM dual;
-- Expected: dba_source (shared) or all_source (per-schema)- Getting Started
- Usage
- Advanced Tools
- Reference
- Development
- Help