Pages

Monday, January 27, 2014

Grant SELECT Permissions on V$ Objects

SELECT * FROM DBA_DATA_FILES return an error when trying to compile PL/SQL Procedure:
ORA-00942 "Table or view does not exist"

Same SQL statement, when running from same user session, is working fine.

The reason is that Oracle Packages require direct Object Permission in order to have access to the Object.

In this case, login as system, and grant explicit SELECT permission on DBA_DATA_FILES to the user that is the package owner.
Same hoes for all objects owned by sys.

sqlplus / as sysdba
GRANT SELECT ON DBA_DATA_FILES TO plsql_user;
GRANT SELECT ON V_$SESSION TO plsql_user;
GRANT SELECT ON V_$STATNAME TO plsql_user;GRANT SELECT ON V_$SESSTAT TO plsql_user;

1 comment:

  1. Hi, guys!
    The following link provides the way to get all references to an Oracle object

    http://dbpilot.net/2018/01/23/getting-all-child-objects-within-an-object/

    ...

    ReplyDelete