Oracle User role Permissions related views

Source: Internet
Author: User

Overview of common related views

Dba_sys_privs: Querying system permissions owned by a user

User_sys_privs: system permissions owned by the current user

Session_privs: All permissions owned by the current user

Role_sys_privs: system permissions owned by a role ( to log in as SYS user )

Role_role_privs: role assigned to the current role

Session_roles: The role that the current user is activating

User_role_privs: The role that the current user is granted

View of access rights for tables :

Table_privileges

All_tab_privs

Role_tab_privs: permissions on related tables that a role is given

examples of using related views

1. Querying permissions owned by the current user

Select * from Session_privs;

2. Query the system permissions that a user has been given .

There can be many ways

Select * from User_sys_privs;

or :

Select * from Dba_sys_privs where grantee= ' XXX ' ( requires user to have DBA role )

3. Query the role that the current user is granted :

1). Select * from Session_roles ORDER by ROLE

Description : This query returns all roles that the current user has been granted , including nested licensing roles . For example , a DBA role is granted to a user , the DBA role

roles that have been granted ( such as exp_full_database and imp_full_database) will be queried, too.

2). Select * from User_role_privs

4. querying the system permissions assigned to a role

Select Privilege from Role_sys_privs where Role=&role

Input role= ' CONNECT '

Output:

PRIVILEGE

--------------------

ALTER SESSION

CREATE CLUSTER

CREATE DATABASE LINK

CREATE SEQUENCE

CREATE SESSION

CREATE synonym

CREATE TABLE

CREATE VIEW

5. Query the role that the current role is granted

Select Granted_role from Role_role_privs where role=&role

Input role= ' DBA '

Output:

Granted_role

----------------------

Delete_catalog_role

Execute_catalog_role

Exp_full_database

Imp_full_database

Plustrace

Select_catalog_role

Description: Plustrace This role is used to execute SQL AUTO trace, which can be generated by executing a $ORACLE _home/sqlplus/admin/plustrce.sql.

Oracle User role Permissions related views

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.