我可以列出直接授予 Oracle 用户的权限吗?

Can I list privileges that were granted DIRECTLY to a user in Oracle?

似乎是 session_privsuser_sys_privs 中的简单选择,提供所有当前权限,但我无法区分其中哪些是从角色继承的,哪些是直接授予的。

有没有办法只列出直接授予的权限?

如果您查询 dictionary,这里有一些有趣的结果:

SQL> select * from dictionary where lower(table_name) like '%user%privs%' order by table_name;

TABLE_NAME                     COMMENTS
------------------------------ ----------------------------------------------------------------------
USER_AQ_AGENT_PRIVS
USER_COL_PRIVS                 Grants on columns for which the user is the owner, grantor or grantee
USER_COL_PRIVS_MADE            All grants on columns of objects owned by the user
USER_COL_PRIVS_RECD            Grants on columns for which the user is the grantee
USER_ROLE_PRIVS                Roles granted to current user
USER_RSRC_CONSUMER_GROUP_PRIVS Switch privileges for consumer groups for the user
USER_RSRC_MANAGER_SYSTEM_PRIVS system privileges for the resource manager for the user
USER_SYS_PRIVS                 System privileges granted to current user
USER_TAB_PRIVS                 Grants on objects for which the user is the owner, grantor or grantee
USER_TAB_PRIVS_MADE            All grants on objects owned by the user
USER_TAB_PRIVS_RECD            Grants on objects for which the user is the grantee

11 rows selected.

SQL>

您可能感兴趣的视图 - 因为它们显示直接授予您的权限 -

  • user_sys_privs
  • user_tab_privs
  • user_role_privs