How to see what privileges are granted to schema of another user

后端 未结 3 380
无人及你
无人及你 2021-01-31 18:18

Consider the case : In a database , I have two users A and B and their corresponding schema.

I want to know , How can I get the information : what permissions are there

3条回答
  •  野的像风
    2021-01-31 18:31

    You can use these queries:

    select * from all_tab_privs;
    select * from dba_sys_privs;
    select * from dba_role_privs;
    

    Each of these tables have a grantee column, you can filter on that in the where criteria:

    where grantee = 'A'
    

    To query privileges on objects (e.g. tables) in other schema I propose first of all all_tab_privs, it also has a table_schema column.

    If you are logged in with the same user whose privileges you want to query, you can use user_tab_privs, user_sys_privs, user_role_privs. They can be queried by a normal non-dba user.

提交回复
热议问题