Method: 1. Use the "select username,account_status,lock_date from dba_users;" command, which can display which users are locked; 2. Use "select * from dba_users where username='specify user instance name' " command, this command can display whether the specified user is locked. If "LOCK_DATE" in the result is empty, it means that it is not locked, and if it is not empty, it means that it is locked.
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
1. Find out which users are locked:
select username,account_status,lock_date from dba_users;
The example is as follows:
2. Check whether the specified user is locked
Check whether a certain user (ABCuser) is locked:
select LOCK_DATE,username from dba_users where username='ABCecuser';
LOCK_DATE Empty means no locking, non-empty means locked.
Check the user status (whether it is locked)
select * from dba_users where username=‘user1’
Expand knowledge
– Unlock user1 to indicate the instance name
ALTER USER user1 ACCOUNT UNLOCK;
– Modify the user password user1 to represent the instance name
alter user user1 identified by newpass;
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to check whether the oracle user is locked. For more information, please follow other related articles on the PHP Chinese website!