Using DBMS_CRYPTO.HASH in a CBAC package giving Ora-942
This is very strange, and not easy to explain, so please bear with me.
Oracle 12.2.0.1 on Linux x86_64.
We have a user called BATCH
who has minimal privileges.
We aim to use this as a account for run scheduled jobs, so we give it minimal privs, and then apply the privileges to stored procedures and use Code Based Access Control (CBAC) to grant the privileges.
The batch run is intensive, including a DBMS_DATA_PUMP import, and creation of various tables in other schemas, so it needs IMP_FULL_DATABASE.
The core issue is that the table creation (in a stored procedured via `EXECUTE IMMEDIATE`) fails with `ORA-942` if the SELECT clause includes a call to `DBMS_CRYPTO.HASH`.