Oracle Current User Roles & Privileges Viewer

Displays all roles and system privileges granted to the currently connected Oracle user. Useful for quickly checking user permissions, role assignments, and privilege levels.

oraclesqlsecurity-auditingv1.0.0
0 stars0 downloads14 views0 comments
By OracleDba • Created

Code

(22 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/my_roles.sql
-- Author       : Tim Hall
-- Description  : Displays a list of all roles and privileges granted to the current user.
-- Requirements : Access to the USER views.
-- Call Syntax  : @user_roles
-- Last Modified: 26/06/2023
-- -----------------------------------------------------------------------------------
set serveroutput on
set verify off

select a.granted_role,
       a.admin_option
from   user_role_privs a
order by a.granted_role;

select a.privilege,
       a.admin_option
from   user_sys_privs a
order by a.privilege;
               
set verify on

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!