Powered By Blogger

Thursday, September 15, 2011

Grant privilege on V$ tables to other users

SQL> grant select on v$session to scott;
grant select on v$session to scott
                *
ERROR at line 1:
ORA-02030: can only select from fixed tables/views

SQL> select owner,object_name,object_type from dba_objects where object_name = 'V$SESSION';
OWNER                          OBJECT_NAME                    OBJECT_TYPE
------------------------------ ------------------------------ -------------------
PUBLIC                         V$SESSION                      SYNONYM

SQL> select table_owner, table_name FROM dba_synonyms where synonym_name = 'V$SESSION';

TABLE_OWNER                    TABLE_NAME
------------------------------ ------------------------------
SYS                            V_$SESSION

SQL> grant select on v_$session to scott;

Grant succeeded.

All the V$ views are synonyms, we can use the above method to query and find the corresponding tables and grant access to other users.

Regards,
Navaneeth

No comments:

Post a Comment