授予在另一个架构上创建同义词的权限(Oracle) [英] grant to create synonyms on another schema (Oracle)
问题描述
我只是想知道是否有任何选项可以授予在不同模式下创建同义词的权限,而无需给出"ANY"选项.我只是想缩小拨款范围,以提供权限,以实现安全目的.
I just wondering if there any option to grant permission to create synonyms on different schema without giving 'ANY' option. I just want to narrow down the grant to provide permission with what is required for security purpose.
我们创建了一个与应用程序产品相关的架构名称A.但是应用程序假定通过另一个(登录)模式B访问对象.我们已将资源授予模式A,因此模式A的所有者可以创建自己的对象.我需要使用什么授予语法来授予模式A来在模式B上创建同义词,以便它可以创建同义词.
We have created a schema name A which related to application product. But the application suppose to access the object through another (login) schema B. We have granted resource to schema A so schema A owner can creates its own objects. What grant syntax i need to use to grant Schema A to create synonyms on schema B, so it can create synonyms.
最终结果应如下所示,并且可以由架构所有者A创建,而不会受到DBA的干扰
End result should be as below and can be created by schema owner A without interference of DBA
B.b_synonym maps to A.b_object
推荐答案
因此,您需要CREATED ANY SYNONYM特权才能将其作为A进行
You need the CREATED ANY SYNONYM privilege to do that as A, therefore
GRANT CREATE ANY SYNONYM TO A;
为避免ANY特权,请执行以下操作:
To avoid the ANY privilege, do this:
a)作为A:
GRANT SELECT ON mytable1 TO B;
GRANT SELECT, INSERT, UPDATE, DELETE ON mytable2 TO B;
b)作为B:
CREATE SYNONYM a_mytable1 FOR A.mytable1;
CREATE SYNONYM a_mytable2 FOR A.mytable2;
这篇关于授予在另一个架构上创建同义词的权限(Oracle)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!