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

后端 未结 3 960
感情败类
感情败类 2021-02-11 16:31

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 \"locke

相关标签:
3条回答
  • 2021-02-11 16:47
    select username,
           account_status 
      from dba_users 
     where lock_date is not null;
    

    This will actually give you the list of locked users.

    0 讨论(0)
  • 2021-02-11 16:48

    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
    
    0 讨论(0)
  • 2021-02-11 17:08

    Found it!

    SELECT username, 
           account_status
      FROM dba_users;
    
    0 讨论(0)
提交回复
热议问题