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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 05:14:25  来源:igfitidea点击:

Grant privileges for an Oracle package?

sqloracleddl

提问by mcvkr

I have a package A, which uses some variables and procedures in another package Bin the same schema. Now I want to move package Ato a new schema. What privileges should I grant to the new schemafor using the package Bsame way? What is the grant statement for that ?

我有一个package A,它package B同一架构中的另一个中使用了一些变量和过程。现在我想转移package A到一个新的架构。我应该new schema为使用package B相同的方式授予什么权限?什么是授权声明?

回答by JohnHC

Use GRANTto give executeprivileges

使用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.

可能值得为包添加一个公共同义词,以便您也可以避免引用模式。