Oracle Permissions
Data Sources covers adding the connection. This page covers what the Oracle user on the other end of that connection needs, so that DataDios lists every object in the schemas you choose and draws lineage from your PL/SQL code.
The short version: grant CREATE SESSION, SELECT_CATALOG_ROLE, read access to your tables, and
EXECUTE on your code. You do not need DEBUG.
1. Why EXECUTE alone is not enough
Oracle has two sets of dictionary views:
- The
ALL_*views (ALL_SOURCE,ALL_OBJECTS,ALL_TRIGGERS) show only the objects the user has been granted. - The
DBA_*views show every object in the database.
The ALL_* views hide two kinds of object from a user that has only EXECUTE and SELECT:
| Object | Hidden from | Shown in the ALL_* view only with |
|---|---|---|
| A package body | ALL_SOURCE | DEBUG on the package |
| A trigger in another schema | ALL_OBJECTS, ALL_TRIGGERS | DEBUG on the trigger's table |
Procedures and functions are not affected: EXECUTE is enough to read their source.
Without one of these grants, a package body gets no lineage and a trigger in another schema is not listed in the
catalog. Many organizations do not grant DEBUG, because it lets a user step through the code while it runs.
DataDios does not need it. With SELECT_CATALOG_ROLE, DataDios reads the package bodies from DBA_SOURCE, and the
triggers from DBA_OBJECTS and DBA_TRIGGERS, for the schemas the data source is set up to read.
Tables still come from ALL_OBJECTS. A table is listed only when the user can read it, and lineage points only at
tables the user can read. Grant READ ANY TABLE, or SELECT on each table, for every table you want in the catalog
and in lineage.
2. The grants
Run these as a user who can grant them, in each pluggable database DataDios reads.
-- A dedicated user for DataDios.
CREATE USER datadios IDENTIFIED BY "<password>";
GRANT CREATE SESSION TO datadios;
-- Reads the DBA_* dictionary views: every object, package body and trigger, and the users and roles.
GRANT SELECT_CATALOG_ROLE TO datadios;
-- Reads table data for previews, profiling and comparisons.
GRANT READ ANY TABLE TO datadios;
-- Or table by table, if you do not grant READ ANY TABLE:
-- GRANT SELECT ON <schema>.<table> TO datadios;
-- On the procedures, functions and packages you want lineage for.
GRANT EXECUTE ON <schema>.<package_or_procedure> TO datadios;
Why EXECUTE is still on the list. DataDios reads the package bodies and triggers from the DBA_* views, but it
still reads some details of your code from ALL_* views, such as the dependencies Oracle records for each procedure.
Those views show only code the user can access.
SELECT_CATALOG_ROLE must be enabled when DataDios connects. A granted role is a default role of the user unless
you have changed the user's default roles. If you have, add it:
ALTER USER datadios DEFAULT ROLE ALL;
3. Optional: lineage from the SQL that ran
DataDios can also draw lineage from the statements Oracle keeps in its cursor cache (V$SQL and V$SQL_PLAN).
Check whether the user can already read them:
SELECT COUNT(*) FROM V$SQL WHERE ROWNUM = 1;
SELECT COUNT(*) FROM V$SQL_PLAN WHERE ROWNUM = 1;
If Oracle answers ORA-00942, grant them:
GRANT SELECT ON SYS.V_$SQL TO datadios;
GRANT SELECT ON SYS.V_$SQL_PLAN TO datadios;
Without them, lineage still shows everything that comes from your code and the dictionary.
4. What not to grant
DEBUG. Not needed withSELECT_CATALOG_ROLE.CREATE ANY TRIGGER. It also makes other schemas' triggers visible inALL_OBJECTS, but it lets the user create triggers in any schema.- The
DBArole. DataDios only reads.
5. Check the setup
Connect as the DataDios user and run:
SELECT COUNT(*) FROM DBA_SOURCE WHERE ROWNUM = 1;
SELECT COUNT(*) FROM DBA_OBJECTS WHERE ROWNUM = 1;
SELECT COUNT(*) FROM DBA_TRIGGERS WHERE ROWNUM = 1;
Each query should return a number. ORA-00942: table or view does not exist means the user cannot read that view.
After changing grants, sync the data source again.
6. Without SELECT_CATALOG_ROLE
DataDios still works. For each view it cannot read, it reads the ALL_* view instead. Then:
- Package bodies the user has no
DEBUGon get no lineage. - Triggers in other schemas are not listed, unless the user has
DEBUGon their tables. - The DataDios server log has a warning that names the view and the grant that would show the hidden objects.
The visibility rules on this page were checked on Oracle Database 23ai.
Related
- Data Sources: adding and testing a connection