Home  >  Article  >  Database  >  How to query oracle user permissions

How to query oracle user permissions

WBOY
WBOYOriginal
2022-01-06 14:55:2643469browse

In Oracle, you can use "dba_sys_privs" to query the user's permissions. "dba_sys_privs" is used to describe the system permissions granted to users and roles. The syntax is "select * from dba_sys_privs where grantee='username'".

How to query oracle user permissions

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to query the permissions of oracle users

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 assigned directly to users or roles):

  select * from dba_sys_privs;
  select * from user_sys_privs;

DBA_SYS_PRIVS describes the system permissions granted to users and roles. This view does not display the USERNAME column

3. View the permissions contained in the role (only the roles owned by the logged-in user can be viewed)

sql>select * from role_sys_privs;

4. View the 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 users or roles:

  select * from dba_role_privs;
  select * from user_role_privs;

7. View which users have sysdba or sysoper system permissions (corresponding permissions are required when querying)

select * from V$PWFILE_USERS

For example, I want to check the permissions of user wzsb:

SQL> select * from dba_sys_privs where grantee='WZSB';

How to query oracle user permissions

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to query oracle user permissions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn