如何检查哪些模式已被授予对 Oracle 对象的 EXECUTE 权限?

发布于 2024-08-01 14:27:18 字数 88 浏览 4 评论 0原文

我需要找出哪些模式已被授予对 Oracle 10g 数据库中某个对象(在本例中为包)的执行权限。 对我来说最简单的方法是什么? 是否有内置函数可以提供此信息?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

森末i 2024-08-08 14:27:18
SELECT grantee
  FROM all_tab_privs
 WHERE table_name = '<your object name>'
  AND privilege = 'EXECUTE'
  AND grantor = '<object owner>';

是的,我知道,它说的是“table_name”,但它也适用于可执行对象。 表 DBA_TAB_PRIVS 也可以工作。 您需要适当的权限(例如,DBA 角色、SELECT ANY TALBE)才能从这些视图中进行选择并查看所有数据。

回应马丁的评论...以上是我所知道的完成您要求的最简单的方法。 如果您想将其限制为包,请尝试以下操作:

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>';
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.

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>';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文