Oracle Permissions-related queries

Source: Internet
Author: User

Oracle permissions-related queries really a bit more views, record the common statements, easy to query:
1. View All Users:
SELECT * from Dba_users;
SELECT * from All_users;
SELECT * from User_users;


2. View user or role system permissions (System permissions that are directly assigned to a user or role):
SELECT * from Dba_sys_privs;
SELECT * from User_sys_privs;

3. View the permissions that are included in the role (can only view the roles owned by the logged-on user)
SELECT * from Role_sys_privs where role= ' DBA ';


4. View User Object permissions:
SELECT * from Dba_tab_privs;
SELECT * from All_tab_privs;
SELECT * from User_tab_privs;


5. View all roles:
SELECT * from Dba_roles;


6. View the roles owned by the user or role:
SELECT * from Dba_role_privs;
SELECT * from User_role_privs;

7. See which users have SYSDBA or Sysoper system permissions (requires appropriate permissions when querying)
SELECT * from V$pwfile_users;

For example, I want to check the permissions of user xxx:
SELECT * from Dba_sys_privs where grantee= ' XXX ';

GRANTEE PRIVILEGE admin_option
------------------------------ ---------------------------------------- ------------
XXX CREATE TRIGGER NO
XXX UNLIMITED tablespace NO


For example, I want to see the user xxx's own role:
SELECT * from Dba_role_privs where grantee= ' XXX ';

GRANTEE granted_role admin_option Default_role
------------------------------ ------------------------------ ------------ ------------
XXX DBA NO YES


View all permissions and roles for a user
Select privilege from Dba_sys_privs where grantee= ' XXX '
Union
Select privilege from Dba_sys_privs where grantee in
(select Granted_role from Dba_role_privs where grantee= ' XXX ');

Oracle Permissions-related queries

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.