Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
Showing results for 
Search instead for 
Did you mean: 

How to get the user informatio?

Chen Yingjie
Frequent Advisor

How to get the user informatio?

Hello everyone.

I want to get following user
information from ORACLE database.

1. username
2. user id
3. role
4. create date

Could someone advise me the
operation procedure?

T G Manikandan
Honored Contributor

Re: How to get the user informatio?

you can just do a

select * from dba_users where username='CHEN';

Honored Contributor

Re: How to get the user informatio?


sqlplus > select * from dba_users;
never give up
Honored Contributor

Re: How to get the user informatio?


to get the user information, you should use the following:
select username, user_id, created
from dba_users
where username like '%&user%'

whereas for the role information:
select grantee, granted_role
from dba_role_privs
where grantee like '%&user%'

and if you want table privileges, try:
select grantee, owner||'.'||table_name, privilege
from dba_tab_privs
where grantee like '%&user%'

and for column level privileges:
select grantee, owner||'.'||table_name, column_name, privilege
from dba_col_privs
where grantee like '%&user%'

hope this helps!

Best Regards
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)