Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...your web site's great! I've been using this system for almost a year now and find it really, really helpful. The people have been helpful in answering just about any question you post in the forums..."

Geography

Where in the world do Tek-Tips members come from?
071 (MIS)
17 Feb 10 10:01
Hello,

I would like to check if one of my users has the following role privileges...

grant select on sys.v_$parameter to ARTROLE
/
grant select on sys.dba_free_space to ARTROLE
/
grant select on sys.dba_tablespaces to ARTROLE
/
grant select on sys.v_$session to ARTROLE
/
grant select on sys.v_$lock to ARTROLE
/


Can anyone tell me what the SQL is to do this ?

I have googled this but can't seem to find info on querying roles within Oracle...

Many thanks.

Cheers,
71

Helpful Member!  carp (MIS)
17 Feb 10 10:41
Try:

CODE

SELECT privilege, table_name, grantable
  FROM dba_tab_privs
 WHERE grantee = 'ARTROLE';
Of course, this will only give you the privileges granted explicitly to the role.  Other privileges may be accessible via roles granted to the role:

CODE

SELECT granted_role
  FROM dba_role_privs
 WHERE grantee = 'ARTROLE';
If this query returns no rows, you are done.  Otherwise, you will need trace out what privileges are granted to the roles that are granted to ARTROLE.
Turkbear (TechnicalUser)
17 Feb 10 10:50
Hi,
To get a list of USERS who have had ARTROLE granted to them, try querying

user_role_privs

Like:

CODE

Select USERNAME,ADMIN_OPTION,DEFAULT_ROLE
from
USE_ROLE_PRIVS
where
GRANTED_ROLE = 'ARTROLE';

 

profile

To Paraphrase:"The Help you get is proportional to the Help you give.."

carp (MIS)
17 Feb 10 11:02
Turkbear -
Won't that just tell you if the account you're currently logged in under has been granted the role?

071 -
Another view you might want to look at would be role_role_privs.  This will tell you which roles are granted to other roles.
071 (MIS)
17 Feb 10 11:03
Thanks Guys,

Carp, your first query only returned the following:

PRIVILEGE                                TABLE_NAME                     GRA
---------------------------------------- ------------------------------ ---
SELECT                                   V_$LOG                         NO
SELECT                                   V_$SESSION                     NO
SELECT                                   V_$LOCK                        NO
SELECT                                   V_$SYSSTAT                     NO
SELECT                                   V_$ROLLNAME                    NO
SELECT                                   V_$ROLLSTAT                    NO
SELECT                                   V_$PARAMETER                   NO
SELECT                                   V_$ROWCACHE                    NO
SELECT                                   V_$LIBRARYCACHE                NO
SELECT                                   V_$DATABASE                    NO
SELECT                                   V_$INSTANCE                    NO

PRIVILEGE                                TABLE_NAME                     GRA
---------------------------------------- ------------------------------ ---
SELECT                                   V_$WAITSTAT                    NO
SELECT                                   V_$ARCHIVE_DEST                NO
SELECT                                   V_$SYSTEM_EVENT                NO
SELECT                                   DBA_ROLES                      NO
SELECT                                   DBA_TAB_PRIVS                  NO
SELECT                                   DBA_USERS                      NO
SELECT                                   DBA_JOBS                       NO
SELECT                                   DBA_FREE_SPACE                 NO
SELECT                                   DBA_DATA_FILES                 NO
SELECT                                   DBA_TABLESPACES                NO
SELECT                                   DBA_TEMP_FILES                 NO

However, I know for a fact that this role should contain the privileges above ?

 

Cheers,
71

071 (MIS)
17 Feb 10 11:14
Oops, busy day...didn't see all of themblush

Thanks again, top marks smile

Cheers,
71

Turkbear (TechnicalUser)
17 Feb 10 12:46
Hi,
Good catch carp, I was too quick to pick a query and forgot about the DBA_ version ( which you cited, even  blush )

 

profile

To Paraphrase:"The Help you get is proportional to the Help you give.."

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close