Oracle存储过程DB Link问题
我有一个属于用户 A
的存储过程 FOO
。用户B
对FOO
具有EXECUTE
权限。
FOO
中的过程之一使用 DB Link 从 BARTABLE@REMOTEDB</code> 检索数据。
A
有一个以用户 AREMOTE
身份连接到 REMOTEDB</code> 的 DB 链接,而
B
有一个同名的 DBLink 连接到REMOTEDB</code> 但作为用户
BREMOTE
。
当B
执行FOO
时,它会使用A
的DB Link(作为AREMOTE
连接)还是B
的 DB Link(作为 BREMOTE
连接)?
我问这个问题是因为我假设属于特定用户的过程只能访问该用户的 dblink,即使另一个用户对该过程具有 EXECUTE
权限。但不知怎的,即使用户AREMOTE
在BARTABLE@REMOTEDB</code>上没有
SELECT
,这个过程也能正常工作,所以我很困惑。
I have a stored procedure FOO
belonging to user A
. User B
has EXECUTE
permission on FOO
.
One of the procedures in FOO
uses a DB Link to retrieve data from BARTABLE@REMOTEDB
. A
has a DB Link to REMOTEDB
connecting as user AREMOTE
while B
has a DBLink with the same name connecting to REMOTEDB
but as user BREMOTE
.
When B
executes FOO
, will it use A
's DB Link (connecting as AREMOTE
) or B
's DB Link (Connecting as BREMOTE
)?
I ask because I assumed a procedure belonging to a particular user would only have access to that user's dblinks even if another user had EXECUTE
on that procedure. But somehow this procedure is working properly even though the user AREMOTE
does not have SELECT
on BARTABLE@REMOTEDB
, so I'm confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该过程应使用为 A 的链接定义的 dblink。任何预言机过程都使用所有者的权限进行处理,除非该过程已使用“调用者权利”进行了定义。 调用者权限
为过程定义的调用者权限告诉代码使用这些权限和对象是调用用户的本地对象,而不是代码所有者的本地对象。默认情况下不这样做的原因是,最终用户通常无权直接更新任何硬对象,但可以通过 API 获得适当的访问权限,这会将正确的业务逻辑应用于更新、插入和删除,以及然后这些对象将公开为最终用户可以访问。
The procedure should use the dblink that is defined for A's link. Any oracle procedure uses the rights of the owner to process, except where that procedure has been defined with "Invoker's Rights". Invoker's Rights
Invoker's rights defined for a procedure tells the code to use the rights and objects local to the calling user, and not the code owner. The reason that this is not done by default is typically an end user will have no rights to any hard objects for direct update, but be given proper access through an API, which would apply the correct business logic to updates, inserts and deletes, and then these objects would be exposed as accessible to the end user.