Site icon Narayana Tutorial

Oracle Database User Unlock, Update and Password Reset

Oracle Database User Unlock, Update, and Password Reset

In this article, explaining how to unlock Oracle database user, update the password, reset the when the password expired.

 

Unlock the database user

Before going to unlock the database user, you can check the user status by using the following query.

Syntax
select username, account_status from dba_users where username = '<db-user-name>';

Example
select username, account_status from dba_users where username = 'NARAYANATUTORIAL';

Output
USERNAME ACCOUNT_STATUS
NARAYANATUTORIAL LOCKED

The username NARAYANATUTORIAL is locked. By using the following query we can unlock the user. Update the password will be done periodically basis

Syntax
alter user <Username> account unlock;

Example
alter user NARAYANATUTORIAL account unlock;

Output
User altered

 

Update the database user password

We can update the database password with new password. The update password will be done periodically or before password expired.ora

Syntax
alter user <Username> identified by <new password>;

Example
alter user NARAYANATUTORIAL identified by <new password>;

Output
User altered

 

Reset the database user password

We can reset the database user password with the original password. Reset password activity will be done when the password expired.

Syntax
alter user <Username> identified by <original password>;

Example
alter user NARAYANATUTORIAL identified by <original password>;

Output
User altered