How to grant access to v$ views



Last updated on August 16th, 2015 at 08:52 am

One can’t grant direct access V$session as v$session is a synonym.
Infact this is true for all the v$ views are they are all synonym’s
SQL> GRANT SELECT ON v$session TO test_user;
grant select on v$session to test_user
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
– shows the V$SESSION is a public synonym
SQL> SELECT owner, object_type FROM dba_objects WHERE object_name = ‘V$SESSION’;
OWNER OBJECT_TYPE
———————— ——————-
PUBLIC SYNONYM
– shows the object (table/view) the synonym points to
SQL> select table_owner, table_name FROM dba_synonyms where synonym_name = ‘V$SESSION’;
TABLE_OWNER TABLE_NAME
————– ——————————
SYS V_$SESSION
How to grant access to v$ views
We can grant access  to these views   by giving  the grant access on the  underlying table/view.
SQL> GRANT SELECT ON V_$SESSION TO test_user;
Grant succeeded.
Note: The same steps can be used to find other V$ views and access can be granted depending on internal representation

Leave a Reply