Unlock a user account.
| Reason for Account Lock | Task | 
|---|---|
| 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. | 
| 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 number of 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. 
 | 
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 John's account 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