How do I get a list of locked users in an Oracle database?

那年仲夏 提交于 2019-12-04 15:06:54

问题


I want to be able to list all of the users in a given database along with an icon that determines whether they are locked or not. The problem I'm having is querying the "locked" status for a given user, I though it might have been on all_users but it isn't. Can anyone point me in the right direction?


回答1:


Found it!

SELECT username, 
       account_status
  FROM dba_users;



回答2:


select username,
       account_status 
  from dba_users 
 where lock_date is not null;

This will actually give you the list of locked users.




回答3:


This suits the requirement:

select username, account_status, EXPIRY_DATE from dba_users where 
username='<username>';

Output:

USERNAME        ACCOUNT_STATUS                   EXPIRY_DA
--------------------------------------------------------------------------------
SYSTEM          EXPIRED                          13-NOV-17


来源:https://stackoverflow.com/questions/1547666/how-do-i-get-a-list-of-locked-users-in-an-oracle-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!