如何在oracle 11g db中找到用户列表?


Answers:


98

我不确定通过“从命令行界面执行”了解什么,但是您可能正在照顾以下select语句:

select * from dba_users;

要么

select username from dba_users;




2

您可以尝试以下操作:(这可能与发布的答案重复,但是我添加了描述)

显示当前用户可以看到的所有用户:

SELECT * FROM all_users;

显示数据库中的所有用户:

SELECT * FROM dba_users;

显示当前用户的信息:

SELECT * FROM user_users;

最后,这将根据创建日期显示当前用户可以看到的所有用户:

SELECT * FROM all_users
ORDER BY created;

1

我尝试了此查询,它对我有用。

SELECT username FROM dba_users 
ORDER BY username;

如果要获取最终用户创建的所有用户的列表,则可以尝试以下操作:

SELECT username FROM dba_users where Default_TableSpace not in ('SYSAUX', 'SYSTEM', 'USERS')
ORDER BY username;
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.