Replacement for Pragma Restrict references Up to Oracle 11.1 you could mark a package as only reading from the database by adding
PRAGMA RESTRICT_REFERENCES( DEFAULT, WNDS);

This has now been deprecated.  I would like to enforce read only on some of the packages.


it would help ensure that junior developers don't add new functionality that writes 'just because'
it makes granting execute on read only packages to report users cleaner


Is there any substitute that can enforce that a package only reads from the database?
I have several poor answers. I hope one of them works for you.


Moving the packages to another schema may be an option. You might then grant that other schema a bare minimum set of privileges. This would get ugly for name resolution, though.
Auditing the code by searching the schema might be another option:

SELECT * FROM dba_source
WHERE schema = 'ME'
  AND name LIKE 'MYPROC'
  AND (UPPER(text) LIKE '%UPDATE %'
       OR UPPER(text) LIKE '%INSERT %'
       OR UPPER(text) LIKE '%DELETE %');

Defining the package as AUTHID CURRENT_USER would scale back the permissions at runtime to the calling user's permissions. This solution has its own can of worms.