Home > Database > Oracle > body text

How to query oracle user permissions

WBOY
Release: 2022-01-06 14:55:26
Original
43387 people have browsed it

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;
Copy after login

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;
Copy after login

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;
Copy after login

4. View the user object permissions:

  select * from dba_tab_privs;
  select * from all_tab_privs;
  select * from user_tab_privs;
Copy after login

5. View all roles:

  select * from dba_roles;
Copy after login

6. View the roles owned by users or roles:

  select * from dba_role_privs;
  select * from user_role_privs;
Copy after login

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

select * from V$PWFILE_USERS
Copy after login

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

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

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!