Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grant privileges for an Oracle package?

Tags:

sql

oracle

ddl

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 ?

like image 826
mcvkr Avatar asked May 22 '17 14:05

mcvkr


People also ask

How do I check permissions on an Oracle package?

Access control for system views and supplied packages Use the following command to see the list of these public database objects and the associated privileges: SELECT table_name, privilege FROM sys. all_tab_privs WHERE grantee='PUBLIC'; All users have SELECT privilege for the ALL_* and USER_* system views.

What privilege is required to run a procedure in Oracle?

The only privileges you can grant on procedures are EXECUTE and DEBUG.

Who can grant system privileges in Oracle?

In general, you grant system privileges only to administrative personnel and application developers. End users normally do not require and should not have the associated capabilities. See Also: For more information about Database Control, see Oracle Database 2 Day DBA.


1 Answers

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.

like image 100
JohnHC Avatar answered Oct 07 '22 12:10

JohnHC