数据库:甲骨文 10g
我可以为某些表向用户授予 DML 命令:
GRANT SELECT, UPDATE, DELETE, INSERT ON USER_A.TABLE_1 TO USER_B;
如何列出 USER_B 收到的所有授权(关于选择、更新、插入、删除)以及哪些表?
我检查了表“all_tab_privs_recd”,但没有我要找的东西。
Oracle 安全专家 Pete Finnegan 提供了几种不同的工具来帮助您回答这些类型的问题。
见: http ://www.petefinnigan.com/tools.htm
特别是,对于上面的问题,请参阅 find_all_privs.sql
希望有帮助。
我不知道如何使用您建议的那些视图来列出 USER_B 收到的所有赠款。
将 USER_A.TABLE_1 上的 SELECT、UPDATE、DELETE、INSERT 授予 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
(all_tab_privs_recd
和all_tab_privs
) 视图仅显示具有显式授权的表,它们不显示 USER_B 拥有的表。(除非授予其他用户。也就是说,GRANTEE 和 OWNER 相同。)为此,您必须all_tables
查看他们拥有哪些表,因此可以完全访问。