oracle 如何列出用户的选择、插入、删除或更新的所有授权
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12099832/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to list all grants of select, insert, delete or update for a user
提问by Delmonte
DB: Oracle 10g
数据库:Oracle 10g
I can grant DML commands to a user for some tables:
我可以为某些表向用户授予 DML 命令:
GRANT SELECT, UPDATE, DELETE, INSERT ON USER_A.TABLE_1 TO USER_B;
How to list all grants (about select, update, insert, delete) that USER_B has received, and for what tables?
如何列出 USER_B 收到的所有授权(关于选择、更新、插入、删除),以及哪些表?
I checked table "all_tab_privs_recd", but doesn't have what I'm looking for.
我检查了表“all_tab_privs_recd”,但没有我要找的东西。
回答by Mark J. Bobak
Pete Finnegan, Oracle security expert extrordinaire, has several different tools available that will help you answer these types of questions.
杰出的 Oracle 安全专家 Pete Finnegan 有多种不同的工具可以帮助您回答这些类型的问题。
See: http://www.petefinnigan.com/tools.htm
见:http: //www.petefinnigan.com/tools.htm
In particular, for the question above, see find_all_privs.sql
特别是上面的问题,参见find_all_privs.sql
Hope that helps.
希望有帮助。
回答by Delmonte
I can't figure out how to use those views that you suggest for listing all grants that USER_B received.
我不知道如何使用您建议的那些视图来列出 USER_B 收到的所有赠款。
GRANT SELECT, UPDATE, DELETE, INSERT ON USER_A.TABLE_1 TO USER_B;
授予选择,更新,删除,插入 USER_A.TABLE_1 到 USER_B;
I query:
我查询:
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
回答by John Doyle
The all_tab_privs_recd
(and the all_tab_privs
) views only show the tables that have explicit grants on them, they don't show the tables that are owned by USER_B. (Unless grants have been given to other users. That is, where the GRANTEE and OWNER are the same.) For that you'd have to look at all_tables
to see what tables they own and therefore have full access to.
在all_tab_privs_recd
(和all_tab_privs
)的意见只能说明对他们明确的补助金表,他们不表明由USER_B拥有的表。(除非授予其他用户。也就是说,GRANTEE 和 OWNER 是相同的。)为此,您必须查看all_tables
他们拥有哪些表并因此具有完全访问权限。