Re: Finding empty Role(s)

  • From: Jonathan Lewis <jlewisoracle@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 13 May 2020 06:44:06 +0100

A role may have object, system, or role privileges granted to it, so
"empty" has to check further than just dba_tab_privs.
I think the following should be adequate (typos excepted, I#m not in front
of a server at present):

select role from dba_roles
minus
select grantee from dba_tab_;privs
minus
select grantee from dba_role_privs
minus
select grantee from dba_sys_privs
;

Regards
Jonathan Lewis


On Tue, May 12, 2020 at 3:14 PM Lyall Barbour <lyallbarbour@xxxxxxxxxxxxxxx>
wrote:

Hello everyone,
  I'm either Googling the wrong keywords, or thinking about this too
hard.  I just revoked a ton of object privs from a non-prod database in
preparation for doing a decommission of a specific schema in a large
database for the Business.  I'm now trying to find any Roles that are empty
because of my revoking.  Does anyone have a script to do this?

TIA
Lyall Barbour
-- //www.freelists.org/webpage/oracle-l

Other related posts: