A Brief Introduction of Oracle Role and Privilege
A Brief Introduction of Oracle Role and Privilege
This brief introduction will cover with the fundamentals of Oracle privilege as well as roles, including how to retrieve all privilege for a user, and how to grant necessary roles or privilege to a user.
1. Basic Views of privileges and roles
- DBA_SYS_PRIVS
- DBA_TAB_PRIVS
- DBA_ROLE_PRIVS
- ROLE_SYS_PRIVS
- SESSION_PRIVS
When granting a privilege to user, the PRIVILEGE will infect immediate; but when granting a role to a user, already connected session have to reconnect or use set role all to refresh the new granted role privileges
2. Script to find all privileges
1
|
select privilege
|
3. Analysis of specific roles
Roles privileges can be retrieved from role_sys_privs view:
Resource role does not have create view privilege, but have unlimited tablespace
1
|
sys@LINORA> select PRIVILEGE, role from role_sys_privs where role = upper('&1');
|
Based on above information, we can grant application user OLAP_USER, CONNECT and RESOURCE roles.
4. Identify users with DBA role
1
|
set line 200
|
EOF

浙公网安备 33010602011771号