Skip to content

Instantly share code, notes, and snippets.

@tap52384
Created August 26, 2020 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tap52384/9a52fb3d7e73ac9fbeea4a98d8ebf794 to your computer and use it in GitHub Desktop.
Save tap52384/9a52fb3d7e73ac9fbeea4a98d8ebf794 to your computer and use it in GitHub Desktop.
Helpful Oracle SQL queries
-- See what has access to a particular table (direct and inherited):
select Grantee,'Granted Through Role' as Grant_Type, role, table_name
from role_tab_privs rtp, dba_role_privs drp
where rtp.role = drp.granted_role
and table_name = :tablename
union
select Grantee,'Direct Grant' as Grant_type, null as role, table_name
from dba_tab_privs
where table_name = :tablename;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment