【问题标题】:How to list all grants of select, insert, delete or update for a user如何列出用户的所有选择、插入、删除或更新授权
【发布时间】:2012-08-19 10:52:31
【问题描述】:

数据库:Oracle 10g

我可以为某些表向用户授予 DML 命令:

GRANT SELECT, UPDATE, DELETE, INSERT ON USER_A.TABLE_1 TO USER_B;

如何列出 USER_B 收到的所有授权(关于选择、更新、插入、删除)以及针对哪些表?

我检查了表“all_tab_privs_recd”,但没有我要查找的内容。

【问题讨论】:

标签: oracle grant


【解决方案1】:

all_tab_privs_recd(和all_tab_privs)视图仅显示具有显式授权的表,它们不显示由 USER_B 拥有的表。 (除非授予其他用户。也就是说,GRANTEE 和 OWNER 相同。)为此,您必须查看 all_tables 以查看他们拥有哪些表,因此可以完全访问。

【讨论】:

    【解决方案2】:

    我不知道如何使用您建议的视图来列出 USER_B 收到的所有赠款。

    将 USER_A.TABLE_1 上的选择、更新、删除、插入授予 USER_B;

    我查询:

    select * from all_tables where owner='USER_A'
    shows 16 rows
    
    Select * from all_tab_privs_recd  where grantor = 'USER_A'
    shows 0 rows
    
    Select * from all_tab_privs_recd  where grantee = 'USER_A'
    shows 0 rows
    
    Select * from all_tab_privs_recd  where grantee = 'USER_B'
    shows 0 rows
    
    Select * from all_tab_privs_recd  where grantor = 'USER_B'
    shows 129 rows, but USER_A is not in grantee, nor in grantor nor in owner
    

    【讨论】:

      【解决方案3】:

      Pete Finnegan,Oracle 安全专家非凡,有几种不同的工具可以帮助您回答这些类型的问题。

      见: http://www.petefinnigan.com/tools.htm

      特别是,对于上面的问题,请参阅 find_all_privs.sql

      希望对您有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2010-11-20
        • 1970-01-01
        • 1970-01-01
        • 2018-12-14
        • 1970-01-01
        相关资源
        最近更新 更多