HOW TO FIND ALL OBJECTS PRIVILEGES GRANTED TO A USER IN AN ORACLE DATABASE
Accounts, Privilegies, Queries
Here is a query to a data dictionary table for finding out all the object privileges that a particular user or a role has. It also displays if a privilege is transferred directly or through a role.
DEMO
DEMO: HOW TO FIND ALL OBJECTS PRIVILEGES GRANTED TO A USER IN AN ORACLE DATABASE
RELATED
HOW TO RETRIEVE AN OBJECT DDL OR A USER DDL USING PL/SQL
HOW TO FIND SYSTEM, ROLES AND OBJECTS PRIVILEGES THAT HAVE BEEN GRANTED TO A USER
QUERY
The DBT_OPFAU script fetches all objects, including objects permissions granted to a specific user. In addition, it provides information on how the privileges are transferred to a user: directly or through a role.
@DBT_OPFAU.sql
Enter value for username: USER_GRANTEE
OWNER | OBJECT_NAME | OBJECT_TYPE | GRANTED_TO | GRANTED_DIRECTLY | GRANTED_THROUGH | PRIVILEGE | GRANTABLE
--------------- | --------------- | --------------- | --------------- | ---------------- | --------------- | ---------- | ---------
USER_OWNER | TABLE_1 | TABLE | USER_GRANTEE | YES | DIRECT GRANT | DELETE | NO
USER_OWNER | TABLE_1 | TABLE | USER_GRANTEE | YES | DIRECT GRANT | INSERT | NO
USER_OWNER | TABLE_1 | TABLE | USER_GRANTEE | YES | DIRECT GRANT | SELECT | NO
USER_OWNER | TABLE_1 | TABLE | USER_GRANTEE | YES | DIRECT GRANT | UPDATE | NO
USER_OWNER | VIEW_1 | VIEW | USER_GRANTEE | NO | ROLE_1 | DELETE | NO
USER_OWNER | VIEW_1 | VIEW | USER_GRANTEE | NO | ROLE_1 | UPDATE | NO
USER_OWNER | VIEW_1 | VIEW | USER_GRANTEE | NO | ROLE_1 | SELECT | NO
USER_OWNER | VIEW_1 | VIEW | USER_GRANTEE | NO | ROLE_1 | INSERT | NO
USER_OWNER | VIEW_2 | VIEW | USER_GRANTEE | NO | ROLE_2 | INSERT | NO
USER_OWNER | VIEW_2 | VIEW | USER_GRANTEE | NO | ROLE_2 | SELECT | NO
USER_OWNER | VIEW_2 | VIEW | USER_GRANTEE | NO | ROLE_2 | DELETE | NO
USER_OWNER | VIEW_2 | VIEW | USER_GRANTEE | NO | ROLE_2 | UPDATE | NO
USER_OWNER | PROC_1 | PROCEDURE | USER_GRANTEE | NO | ROLE_3 | EXECUTE | NO
USER_OWNER | MATVIEW_1 | TABLE | USER_GRANTEE | NO | ROLE_3 | SELECT | NO
14 rows selected.
Written At
21 NOV 202113:20
OEL Release
7.9 x64
Database Release
19.12.0.0.0
Tags In
Share
- Accounts
- Auditing
- AWR
- Bash Scripts
- Datapump
- Default Category
- Demos
- Directory Objects
- Environment Variables
- Initialization Parameters
- Iptables
- Java Program
- Memory Usage
- Metadata API
- Networker
- NLS Settings
- Optimizer Statistics
- ORA-00942
- ORA-01031
- ORA-01720
- ORA-28001
- ORA-31671
- Oracle Database
- Oracle Enterprise Manager
- Performance Tunning
- Postfix
- Privilegies
- Processes
- Queries
- Red Hat Enterprise Linux
- Redo Logs
- Session Tracing
- Sessions
- SQL Trace
- SQLPlus
- Statspack
- Tablespaces
- UTL_FILE
- UTL_FILE_DIR
- Wait Events
- Yum