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

3

37

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?

Liponis answered 10/10, 2009 at 11:5 Comment(0)
L
46

Found it!

SELECT username, 
       account_status
  FROM dba_users;
Liponis answered 10/10, 2009 at 11:22 Comment(0)
O
37
select username,
       account_status 
  from dba_users 
 where lock_date is not null;

This will actually give you the list of locked users.

Organ answered 10/12, 2010 at 12:38 Comment(0)
A
2

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
Anthony answered 17/11, 2017 at 5:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.