mcvkr
mcvkr

Reputation: 3922

Grant privileges for an Oracle package?

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 ?

Upvotes: 26

Views: 144724

Answers (1)

JohnHC
JohnHC

Reputation: 11205

Use GRANT to give execute privileges

grant execute on PACKAGE_B to new_schema;

Then, you need to ensure that any reference in package A includes the full path:

PACKAGE_B.SOME_PROC

It might be worth creating a public synonym in for the package, so that you can avoid referencing the schema too.

Upvotes: 42

Related Questions