Home >Database >Oracle >How to query all users in oracle

How to query all users in oracle

WBOY
WBOYOriginal
2022-04-07 11:02:5523227browse

In Oracle, you can use the select statement to query all users. This statement is used to select data from the database and store the results in a result set. Use "dba_users" to represent all users in the database. Syntax is "select * from dba_users;".

How to query all users in oracle

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

How to query all users in oracle

Query all user information in oracleselect*fromdba_users;

View all users:

select * from dba_users;

View all users in the database, provided that you have an account with DBA authority, such as sys, system

select * from all_users;

View all users you can manage

select * from user_users;

View current user information

Expand knowledge:

View user or role system permissions (system permissions directly assigned to users or roles):

select * from dba_sys_privs;
select * from user_sys_privs; (查看当前用户所拥有的权限)

View roles (only view Permissions contained in the roles owned by the logged in user)

sql>select * from role_sys_privs;

View user object permissions:

select * from dba_tab_privs;
select * from all_tab_privs;
select * from user_tab_privs;

View all roles:

select * from dba_roles;

View the roles owned by the user or role:

select * from dba_role_privs;
select * from user_role_privs;

Check which users have sysdba or sysoper system permissions (corresponding permissions are required when querying)

select * from V$PWFILE_USERS

Check the permissions owned by a user in SqlPlus

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

where username is the user name It has to be capitalized.

For example:

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

How to delete all tables of a specified user in Oracle

select 'Drop table '||table_name||';' from all_tables where owner='要删除的用户名(注意要大写)';

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to query all users in oracle. 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