Changes user settings.
Syntax 1 – Change the definition of a database user
ALTER USER user-name | [ IDENTIFIED BY password ] | [ LOGIN POLICY policy-name ] | [ FORCE PASSWORD CHANGE { ON | OFF } ]
Syntax 2 – Refresh the Distinguished Name (DN) for an LDAP user
ALTER USER user-name REFRESH DN
Syntax 3 – Revert a user's login policy to the original values
ALTER USER user-name RESET LOGIN POLICY
Syntax 4 – Change a user's password when CHANGE_PASSWORD_DUAL_CONTROL is enabled in a user's login policy.
ALTER USER user-name IDENTIFIED [ FIRST | LAST ] BY password_part
ALTER USER SQLTester IDENTIFIED BY welcome LOGIN POLICY Test1 FORCE PASSWORD CHANGE OFF
ALTER USER Mary REFRESH DN
User1 enters:
ALTER USER user3 IDENTIFIED FIRST BY PassPart1
User2 enters:
ALTER USER user3 IDENTIFIED LAST BY PassPart2
Once set, user3 logs on by entering the password PassPart1PassPart2.
If you set the PASSWORD_EXPIRY_ON_NEXT_LOGIN value to ON, the passwords of all users assigned to this login policy expire immediately when he or she next logs in. You can use the ALTER USER and LOGIN POLICY clauses to force users to change their passwords at the next login.
If the target user is already logged in when the dual password change process occurs, the user cannot change their password in the current session until both parts of the new password are set. Once the dual password change process is complete, the target user can use GRANT CONNECT, ALTER USER, sp_password, or sp_iqpassword to the password without first logging out. The prompt to enter the current password, use the new dual control password, not the password originally entered for the current session.
The GRANT CONNECT statement is not supported during for the dual password change process to set either password part. However, once the dual password change process is complete, the target user can use the GRANT CONNECT statement, ALTER USER, sp_password, or sp_iqpassword to change their password without first logging out.
As soon as both parts of the password are successfully specified by users with the CHANGE PASSWORD system privilege, the password for the target user is automatically expired. This forces the target user to change the password the next time he or she logs in.