Checking Roles Granted to a User : Roles « User Privilege « Oracle PL/SQL Tutorial

Home
Oracle PL/SQL Tutorial
1.Introduction
2.Query Select
3.Set
4.Insert Update Delete
5.Sequences
6.Table
7.Table Joins
8.View
9.Index
10.SQL Data Types
11.Character String Functions
12.Aggregate Functions
13.Date Timestamp Functions
14.Numerical Math Functions
15.Conversion Functions
16.Analytical Functions
17.Miscellaneous Functions
18.Regular Expressions Functions
19.Statistical Functions
20.Linear Regression Functions
21.PL SQL Data Types
22.PL SQL Statements
23.PL SQL Operators
24.PL SQL Programming
25.Cursor
26.Collections
27.Function Procedure Packages
28.Trigger
29.SQL PLUS Session Environment
30.System Tables Data Dictionary
31.System Packages
32.Object Oriented
33.XML
34.Large Objects
35.Transaction
36.User Privilege
Oracle PL/SQL Tutorial » User Privilege » Roles 
36.7.6.Checking Roles Granted to a User

You can check which roles have been granted to a user by querying user_role_privs. A user who creates a role is also granted that role by default.

SQL> desc user_role_privs;
 Name                  Type              Description
 USERNAME                    VARCHAR2(30--Name of the user to whom the role has been granted.
 GRANTED_ROLE                VARCHAR2(30--Name of the role granted to the user.
 ADMIN_OPTION                VARCHAR2(3)  --Whether the user is able to grant the role to another user or role. Equal to YES or NO.
 DEFAULT_ROLE                VARCHAR2(3)  --Whether the role is enabled by default when the user connects to the database. Equal to YES or NO.
 OS_GRANTED                  VARCHAR2(3)  --Whether the role was granted by the operating system.

SELECT FROM user_role_privs;
36.7.Roles
36.7.1.Roles
36.7.2.Creating Roles
36.7.3.Granting Privileges to Roles
36.7.4.Granting Roles to a User
36.7.5.Assign Role to User
36.7.6.Checking Roles Granted to a User
36.7.7.Checking System Privileges Granted to a Role
36.7.8.Checking Object Privileges Granted to a Role
36.7.9.Assign CONNECT and RESOURCE Roles
36.7.10.Default Roles
36.7.11.Revoking a Role
36.7.12.Revoking Privileges from a Role
36.7.13.Dropping a Role
36.7.14.Regina and Kristen are manager level users
36.7.15.Rich and Brad are maintenance level users
36.7.16.Unassign Role
36.7.17.Drop Role
36.7.18.Assign object privileges to roles
36.7.19.Unassign Role from User
36.7.20.Output session roles from procedure
36.7.21.Query user granted roles
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.