Background documentationALTER PASSWORD Statement (alter_password_statement) Locate this document in the navigation structure

 

The ALTER PASSWORD statement (alter_password_statement) is required to alter the password of a database user.

Structure

Syntax Syntax

  1. <alter_password_statement> ::=
      ALTER PASSWORD <old_password> TO <new_password>
    | ALTER PASSWORD <user_name> <new_password>
    
    <old_password> ::=
      <password>
    
    <new_password> ::=
      <password>
End of the code.
Examples

SQL Tutorial, Database Users and Their Privileges

Explanation

You can change the password for the current database user using ALTER PASSWORD <old_password> TO <new_password>. The old password must be the same as the password stored in the database catalog for the current user.

If you want to change a password for a database user using user_name, then the current database user must be the database system administrator.

The new password must be specified in the CONNECT statement when the user next opens a database session.

More Information

Database Administration, Conventions for User Names and Passwords