SQL 授予 Oracle 包的权限?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44115791/
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
Grant privileges for an Oracle package?
提问by mcvkr
I have a package A
, which uses some variables and procedures in another package B
in the same schema. Now I want to move package A
to a new schema. What privileges should I grant to the new schema
for using the package B
same way? What is the grant statement for that ?
我有一个package A
,它package B
在同一架构中的另一个中使用了一些变量和过程。现在我想转移package A
到一个新的架构。我应该new schema
为使用package B
相同的方式授予什么权限?什么是授权声明?
回答by JohnHC
Use GRANTto give execute
privileges
使用GRANT授予execute
权限
grant execute on PACKAGE_B to new_schema;
Then, you need to ensure that any reference in package A includes the full path:
然后,您需要确保包 A 中的任何引用都包含完整路径:
PACKAGE_B.SOME_PROC
It might be worth chucking a public synonym in for the package, so that you can avoiud referencing the schema too.
可能值得为包添加一个公共同义词,以便您也可以避免引用模式。