How to find the users list in oracle 11g db?

SqlOracle11g

Sql Problem Overview


How to find out the users list, which is all created in the oracle 11g database. Is there any command to find out the users list which we can execute from the Command line interface!

Sql Solutions


Solution 1 - Sql

I am not sure what you understand by "execute from the Command line interface", but you're probably looking after the following select statement:

select * from dba_users;

or

select username from dba_users;

Solution 2 - Sql

select * from all_users

This will work for sure

Solution 3 - Sql

The command select username from all_users; requires less privileges

Solution 4 - Sql

You can try the following: (This may be duplicate of the answers posted but I have added description)

Display all users that can be seen by the current user:

SELECT * FROM all_users;

Display all users in the Database:

SELECT * FROM dba_users;

Display the information of the current user:

SELECT * FROM user_users;

Lastly, this will display all users that can be seen by current users based on creation date:

SELECT * FROM all_users
ORDER BY created;

Solution 5 - Sql

You can think of a mysql database as a schema/user in Oracle. If you have the privileges, you can query the DBA_USERS view to see the list of schema.

Solution 6 - Sql

I tried this query and it works for me.

SELECT username FROM dba_users 
ORDER BY username;

If you want to get the list of all that users which are created by end-user, then you can try this:

SELECT username FROM dba_users where Default_TableSpace not in ('SYSAUX', 'SYSTEM', 'USERS')
ORDER BY username;

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionArun BlrView Question on Stackoverflow
Solution 1 - SqlRené NyffeneggerView Answer on Stackoverflow
Solution 2 - SqlJonesView Answer on Stackoverflow
Solution 3 - SqlJean-François PerrotView Answer on Stackoverflow
Solution 4 - SqlGauravsaView Answer on Stackoverflow
Solution 5 - Sqluser3177895View Answer on Stackoverflow
Solution 6 - SqlArsman AhmadView Answer on Stackoverflow