Get the App
SLTechnology News&Howtos  ›  Database  › 

Query commands related to Oracle permissions

Shulou Source: shulou.com Published: 2022-05-31 17:58:25 11月24日 Update

This article mainly explains the "Oracle permissions-related query commands", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Oracle permissions-related query commands"!

There are many views related to Oracle permissions. Record the commonly used statements to facilitate the query:

1. View all users:

Select * from dba_users

Select * from all_users

Select * from user_users

two。 View user or role system permissions (system permissions assigned directly to a user or role):

Select * from dba_sys_privs

Select * from user_sys_privs

3. View the permissions contained in roles (you can only view roles owned by logged-in users)

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. Check which users have sysdba or sysoper system permissions (appropriate permissions are required for query)

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 check the roles owned by user XXX:

Select * from dba_role_privs where grantee='XXX'

GRANTEE GRANTED_ROLE ADMIN_OPTION DEFAULT_ROLE

-

XXX DBA NO YES

View all permissions and roles of 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')

Thank you for your reading, the above is the content of "Oracle permissions-related query commands". After the study of this article, I believe you have a deeper understanding of the problem of Oracle permissions-related query commands, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Permissions users roles queries commands systems learning content I want objects that is commonly used ideas situations articles more real knowledge knowledge points articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn OPPO Reno Shulou Technology Apple Shulou Information