grant debug?
A reader, November 19, 2015 - 3:27 pm UTC
I believe grant debug can solve the OP's issue.
GRANT DEBUG ON <name of package> to <name of user>;
This should make the package body source be visible in ALL_SOURCE, which any user is likely to have access to.
Note SQL Developer 2.1 (which is a really old version) had a bug where it wouldn't show the package body even with grant debug. Only a problem with that product and that version.
November 20, 2015 - 2:13 am UTC
Thanks for the information. Neat solution
SELECT_CATALOG_ROLE
kulauk, September 12, 2018 - 2:00 pm UTC
Would granting SELECT_CATALOG_ROLE to the user give them the ability to see the package source code?
As i understand it SELECT_CATALOG_ROLE gives read only access to DBA_% views which will include DBA_SOURCE.
What do you think?
September 17, 2018 - 5:24 am UTC
That is a solution but it seems overkill to me. Yes they get DBA_SOURCE but they get DBA_ everything else as well.
DEBUG privilege on package
A reader, October 29, 2022 - 7:38 pm UTC
Greetings !
We have Developers asking for DEBUG on package for them to see the code for verification after the database deployment in production. Dev connects to database via their read-only account from SQL Developer.
Can you please clarify and provide your thoughts ?
1. Is it safe to grant DEBUG on package to Read-only users . just for reading the package body ?
Read-only users who got DEBUG package privilege,, Can they do
more than just reading the package and package body. like compilation etc.. ?
We want to limit them to see the package/package body only.
Thanks for your time!
October 31, 2022 - 4:07 am UTC
One method would be to have the DBA create a view of DBA_SOURCE for you:
create view your_view
as
select * from dba_source
where owner = 'YOUR_ACCOUNT';
Then no additional privs needed.