Unlocking User Accounts

Unlock a user account.

Prerequisites
Requires the MANAGE ANY USER system privilege.
Task
The manner in which you unlock an account depends on how it was originally locked.
  1. If a user account is locked because it is assigned to a login policy with the locked option set to ON, reassign the user to a login policy with the locked option set to OFF.
  2. If a user account is locked because it has exceeded the MAX_FAILED_LOGIN_ATTEMPTS or MAX_DAYS_SINCE_LOGIN, issue the ALTER USER statement with the RESET LOGIN POLICY option. Forcing the reset of the login policy reverts the settings of the user's login to the original values in the login policy. This usually clears all locks that are implicitly set due to the user exceeding the failed logins or exceeding the maximum number of days since the last login.
    Note: Resetting the values in the login policy assigned to a user does not reset the values for all users assigned the same login policy.

Example

Assuming that the LOCKED option in login policy lp is set to OFF, this example replaces the login policy currently assigned to John with login policy lp:
ALTER USER john LOGIN POLICY lp
Assuming the account of John is locked because he either exceeded the MAX_FAILED_LOGIN_ATTEMPTS or MAX_DAYS_SINCE_LOGIN, this example forces the reset of the values in the login policy currently assigned to John:
ALTER USER john RESET LOGIN POLICY
Related concepts
Automatic Unlocking of User Accounts
Related reference
ALTER LOGIN POLICY Statement
ALTER USER Statement