ALTER USER statement

Description

Changes user settings.

Syntax

Syntax 1

ALTER USER  user-name  [ IDENTIFIED BY password ]  [ LOGIN POLICY policy-name ]  [ FORCE PASSWORD CHANGE { ON | OFF } ]

Syntax 2

ALTER USER  user-name  [ RESET LOGIN POLICY ]

Examples

Example 1

The following alters a user named SQLTester. The password is set to “welcome”. The SQLTester user is assigned to the Test1 login policy and the password does not expire on the next login.

ALTER USER SQLTester IDENTIFIED BY welcomeLOGIN POLICY Test1FORCE PASSWORD CHANGE off;

Usage

user-name The name of the user.

IDENTIFIED BY clause Clause providing the password for the user.

policy-name The name of the login policy to assign the user. No change is made if the LOGIN POLICY clause is not specified.

FORCE PASSWORD CHANGE clause Controls whether the user must specify a new password when they log in. This setting overrides the password_expiry_on_next_login option setting in their policy.

RESET LOGIN POLICY clause 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. When you reset a login policy, a user can access an account that has been locked for exceeding a login policy option limit such as max_failed_login_attempts or max_days_since_login.

Enhanced ALTER LOGIN POLICY syntax for multiplex is described in Using Sybase IQ Multiplex.

User IDs and passwords cannot:

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 they next log in. You can use the ALTER USER and LOGIN POLICY clauses to force a user to change the password when he next logs in.

Standards

Permissions

Must be owner of the view or have DBA authority.

See also

“ALTER LOGIN POLICY statement”

“COMMENT statement”

“CREATE LOGIN POLICY statement”

“CREATE USER statement”

“DROP LOGIN POLICY statement”

“DROP USER statement”

“GRANT statement”

“Managing login policies overview” in SQL Anywhere Server – Database Administration > Configuring Your Database > Managing user IDs, authorities, and permissions

“REVOKE statement”