Home> Database> Oracle> body text

How to check whether the oracle user is locked

WBOY
Release: 2022-08-02 16:06:41
Original
10645 people have browsed it

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;
Copy after login

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';
Copy after login

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’
Copy after login

Expand knowledge

– Unlock user1 to indicate the instance name

ALTER USER user1 ACCOUNT UNLOCK;
Copy after login

– Modify the user password user1 to represent the instance name

alter user user1 identified by newpass;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!