How do I find all the users that can access one particular table?
For example table 'Table01'
Thanks
How do I find all the users that can access one particular table?
For example table 'Table01'
Thanks
If you are sys user then you can use dba_tab_privs
view as shown below.
SQL>Conn / as sysdba
SQL>select grantee, table_name, privilege from dba_tab_privs where table_name='Table01';
Update:
As Justin Cave and mustaccio said, its a bit complex to get the accurate result from general dba_
or role_
views.
Though you can query role_tab_privs
to get all the roles and its object privileges.
SQL> select grantee, privilege from dba_tab_privs where table_name='EMPLOYEES' and owner='HR';
GRANTEE PRIVILEGE
------------------------------ ----------------------------------------
SCOTT SELECT
OE SELECT
OE REFERENCES
JAY UPDATE
R1 SELECT
In the above result Grantee R1
is a role which has SELECT
object privilege on EMPLOYEES
table.
Here is a useful post similar to this. oracle - list users with access to certain tables