Oracle Users with SYS Privilege Report

Displays users granted a specified system privilege, including account lock and expiry dates. Useful for security auditing and privilege review.

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

Code

(20 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/users_with_sys_priv.sql
-- Author       : Tim Hall
-- Description  : Displays a list of users granted the specified role.
-- Requirements : Access to the DBA views.
-- Call Syntax  : @users_with_sys_priv "UNLIMITED TABLESPACE"
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------

SET VERIFY OFF
COLUMN username FORMAT A30

SELECT username,
       lock_date,
       expiry_date
FROM   dba_users
WHERE  username IN (SELECT grantee
                    FROM   dba_sys_privs
                    WHERE  privilege = UPPER('&1'))
ORDER BY username;

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!