Home >Database >Oracle >How to check whether the oracle user is locked

How to check whether the oracle user is locked

WBOY
WBOYOriginal
2022-08-02 16:06:4110844browse

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.

How to check whether the oracle user is locked

The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.

How to check whether the oracle user is locked

1. Find out which users are locked:

select username,account_status,lock_date from dba_users;

The example is as follows:

How to check whether the oracle user is locked

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn