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 ?
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.
The only privileges you can grant on procedures are EXECUTE and DEBUG.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With