← Users & Privileges
Oracle · Users & Privileges

How to reset a user password in Oracle

Reset an Oracle user's password with ALTER USER IDENTIFIED BY, with an option to force a change at next login.

Tested on11g12c19c21c23ai26ai

Set a new password for an account, with an option to force a change at next login.

This changes the user's password. Never store a real password in a script; replace the placeholder at run time.

ALTER USER &&username IDENTIFIED BY "Replace_This_Passw0rd#";

-- Optional: force a password change at next login
-- ALTER USER &username PASSWORD EXPIRE;

-- Verify (read-only)
SELECT username, account_status, expiry_date
FROM   dba_users
WHERE  username = UPPER('&username');
passwordresetalter-user