How to view the permissions or roles of the current Login User in Oracle

Source: Internet
Author: User

How to view the permissions or roles of the current Login User in Oracle

View the role of the current user

SQL> select * from user_role_privs;

SQL> select * from session_privs

View the system and table-level permissions of the current user

SQL> select * from user_sys_privs;

SQL> select * from user_tab_privs;

Appendix:

1. View users:

1. view the current user:

Select * from v $ session;

2. View All Users:

Select * from dba_users;

Select * from all_users;

Select * from user_users;

Ii. View roles:

1. All roles activated by the current user

Select * from session_roles;

2. role assigned to the current user

Select * from user_role_privs;

2. Roles granted to all users

Select * from dba_role_privs;

3. view all roles:

Select * from dba_roles;

4. query the roles assigned to the current role

Select GRANTED_ROLE from ROLE_ROLE_PRIVS where ROLE = & ROLE; -- for example, role = 'dba'

3. View permissions:

1. Basic permission query:

Select * from session_privs; -- all permissions of the current user

Select * from user_sys_privs; -- system permission of the current user

Select * from user_tab_privs; -- table-level permissions of the current user

Select * from dba_sys_privs; -- query the system permissions of a user

Select * from role_sys_privs; -- view the permissions of a role (only the roles owned by the login user can be viewed)

2. View user object permissions:

Select * from dba_tab_privs;

Select * from all_tab_privs;

Select * from user_tab_privs;

3. Check which users have sysdba or sysoper system permissions (the corresponding permissions are required for query)

Select * from V $ PWFILE_USERS

Note:

1. Run the following statement to view the system permissions provided by Oracle:

Select name from sys. system_privilege_map

2. View All system permissions of a user (including the system permissions of the role)

SQL code

Select privilege from dba_sys_privs where grantee = 'datauser'

Union

Select privilege from dba_sys_privs where grantee in (select granted_role from dba_role_privs where grantee = 'datauser ');

Related Article

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.