如何获取 Oracle 数据库中锁定用户的列表?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1547666/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 02:09:42  来源:igfitidea点击:

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

oraclesystem-administrationlocked

提问by ninesided

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_usersbut it isn't. Can anyone point me in the right direction?

我希望能够列出给定数据库中的所有用户以及确定他们是否被锁定的图标。我遇到的问题是查询给定用户的“锁定”状态,我虽然它可能已经打开all_users但它不是。任何人都可以指出我正确的方向吗?

回答by ninesided

Found it!

找到了!

SELECT username, 
       account_status
  FROM dba_users;

回答by sweetfa

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

This will actually give you the list of locked users.

这实际上会给你锁定用户的列表。

回答by gautham p

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