Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

query to find all the users in a database with rights other than select

lmuJul 4 2018 — edited Jul 4 2018

Hi,

I need a query to find a list of users in a database with rights other than select.  Similar to this which doesn't work. It leaves some users out.

SELECT DISTINCT

  DTP.GRANTEE,

  DRP.ADMIN_OPTION,

USR.account_status

FROM

  DBA_TAB_PRIVS DTP,

DBA_ROLE_PRIVS DRP,

  dba_users USR

WHERE 1=1

AND dtp.grantee = DRP.GRANTEE(+)

AND drp.grantee = usr.username

and dtp.grantee=usr.username(+)

and dtp.grantee in (

select username from dba_users

where account_status = 'OPEN')

AND PRIVILEGE <> 'SELECT'

order by grantee

I have this for EBS, which now that i look at this, probably isn't correct either.

SELECT DISTINCT

DTP.GRANTEE,

USR.DESCRIPTION,

DRP.ADMIN_OPTION,

USR.ENABLED_FLAG

FROM

DBA_TAB_PRIVS DTP,

DBA_ROLE_PRIVS DRP,

APPS.FND_ORACLE_USERID USR

WHERE 1=1

AND dtp.grantee = DRP.GRANTEE(+)

AND drp.grantee = USR.ORACLE_USERNAME(+)

AND PRIVILEGE <> 'SELECT';

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 1 2018
Added on Jul 4 2018
1 comment
4,655 views