如何检查哪些模式已被授予对 Oracle 对象的 EXECUTE 权限?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1255310/
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 do I check which schemata have been granted EXECUTE permission on an Oracle object?
提问by MPritchard
I need to find out which schemata have already been granted execute permission on a certain object in an Oracle 10g db (in this case, a package). What's the simplest way for me to do this? Is there a built-in function to provide this information?
我需要找出哪些模式已被授予对 Oracle 10g 数据库(在本例中为包)中的某个对象的执行权限。对我来说最简单的方法是什么?是否有内置函数来提供这些信息?
采纳答案by DCookie
SELECT grantee
FROM all_tab_privs
WHERE table_name = '<your object name>'
AND privilege = 'EXECUTE'
AND grantor = '<object owner>';
Yeah, I know, it says "table_name" but it applies to executable objects as well. The table DBA_TAB_PRIVS works as well. You'll need appropriate permissions (e.g., DBA role, SELECT ANY TALBE) to select from these views and see all the data.
是的,我知道,它说的是“table_name”,但它也适用于可执行对象。表 DBA_TAB_PRIVS 也能正常工作。您需要适当的权限(例如,DBA 角色、SELECT ANY TALBE)才能从这些视图中进行选择并查看所有数据。
In response to Martin's comment... The above is the easiest way to do what you asked for that I know of. If you want to limit it to packages, try this:
回应马丁的评论......以上是我所知道的按照你的要求做的最简单的方法。如果要将其限制为包,请尝试以下操作:
SELECT * FROM all_tab_privs JOIN all_objects ON (table_name = object_name)
WHERE table_name = '<your object name>'
AND object_type = 'PACKAGE'
AND privilege = 'EXECUTE'
AND grantor = '<object owner>';