向 Oracle 的另一个用户授予存储过程的权限
我是一名本科生,在将数据库 Oracle 10g 模式 =xe 中用户 B 拥有的存储过程的所有权授予用户 A 时遇到了一些问题。
请帮助我编写sql命令,将存储过程xyz的所有权授予另一个用户A。
I am a student of Undergraduate studies , and I am facing little problem in granting rights of ownership to a user A to a stored procedure being owned by user B in database Oracle 10g mode =xe.
Please help me in writing sql commands for granting rights of ownership on stored procedure xyz to another user A.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我不确定我是否理解你所说的“所有权”的意思。
如果用户 B 拥有一个存储过程,则用户 B 可以授予用户 A 运行该存储过程的权限
,然后用户 A 将使用完全限定名称调用该过程,即,或者
,用户 A 可以创建同义词以避免必须使用完全限定的过程名称。
I'm not sure that I understand what you mean by "rights of ownership".
If User B owns a stored procedure, User B can grant User A permission to run the stored procedure
User A would then call the procedure using the fully qualified name, i.e.
Alternately, User A can create a synonym in order to avoid having to use the fully qualified procedure name.
你不能做我认为你要求做的事。
您可以授予过程的唯一权限是 EXECUTE 和 DEBUG。
如果要允许用户 B 在用户 A 架构中创建过程,则用户 B 必须具有 CREATE ANY PROCEDURE 权限。 ALTER ANY PROCEDURE 和 DROP ANY PROCEDURE 是更改或删除用户 B 的用户 A 过程所需的其他适用权限。所有权限都是广泛的权限,因为它不会将用户 B 限制为任何特定模式。如果被授予这些权限,用户 B 应该受到高度信任。
编辑:
正如 Justin 提到的,向 A 授予 B 拥有的过程的执行权的方法:
You can't do what I think you're asking to do.
The only privileges you can grant on procedures are EXECUTE and DEBUG.
If you want to allow user B to create a procedure in user A schema, then user B must have the CREATE ANY PROCEDURE privilege. ALTER ANY PROCEDURE and DROP ANY PROCEDURE are the other applicable privileges required to alter or drop user A procedures for user B. All are wide ranging privileges, as it doesn't restrict user B to any particular schema. User B should be highly trusted if granted these privileges.
EDIT:
As Justin mentioned, the way to give execution rights to A for a procedure owned by B:
Oracle 中的包和存储过程默认使用包/过程所有者的权限执行,而不是当前登录用户的权限。
因此,例如,如果您调用创建用户的包,则它是包所有者,而不是需要创建用户权限的调用用户。调用者只需要拥有包的执行权限即可。
如果您希望使用调用用户的权限运行包,那么在创建包时,您需要指定 AUTHID CURRENT_USER
Oracle 文档“调用者权限与定义者权限”有更多信息 http://docs.oracle.com/cd/A97630_01/appdev.920/a96624/08_subs.htm# 18575
希望这有帮助。
Packages and stored procedures in Oracle execute by default using the rights of the package/procedure OWNER, not the currently logged on user.
So if you call a package that creates a user for example, its the package owner, not the calling user that needs create user privilege. The caller just needs to have execute permission on the package.
If you would prefer that the package should be run using the calling user's permissions, then when creating the package you need to specify AUTHID CURRENT_USER
Oracle documentation "Invoker Rights vs Definer Rights" has more information http://docs.oracle.com/cd/A97630_01/appdev.920/a96624/08_subs.htm#18575
Hope this helps.
在您的 DBA 帐户上,授予 USERB 使用 grant
grant create any procedure to USERB
创建过程的权利该过程将看起来
GRANT EXECUTE ON USERB.USERB_PROCEDURE TO USERA
我知道这一点这是一个非常古老的问题,但我希望我能稍微解决一下。
On your DBA account, give USERB the right to create a procedure using grant
grant create any procedure to USERB
The procedure will look
GRANT EXECUTE ON USERB.USERB_PROCEDURE TO USERA
I know this is a very old question but I am hoping I could chip it a bit.
当我们想要向“testdb”用户授予创建权限时,这是一个命令。
This is a command when we want to give create privilege to "testdb" user.