Skip to content
Home » Oracle » How to Resolve ORA-28002: the password will expire within 7 days

How to Resolve ORA-28002: the password will expire within 7 days

ORA-28002

ORA-28002 means that the password of the user will expire soon in N days, although the user is allowable to connect to the database. The error reminds you that to change the password in advance.

SQL> conn hr/hr@orclpdb
ERROR:
ORA-28002: the password will expire within 7 days


Connected.

The database warned us that the password will expired in 7 days with ORA-28002. In fact, password expiration is controlled by password life time (PASSWORD_LIFE_TIME) in user's profile, the shorter lifetime, the sooner users see ORA-28002.

Solutions to ORA-28002

Theoretically, once the grace time is triggered, it has no way to return, but we have some ideas for you to think of.

There're several ways to solve ORA-28002.

  1. Change Password
  2. The formal way to solve it is to change the password.

  3. Defer Expiration
  4. An unofficial way to solve it is to revert the expiration.

Change Password

As an user, you may change your password right away. To reuse the original password you forgot to set password, there will be more works to do.

SQL> password
Changing password for HR
Old password:
New password:
Retype new password:
Password changed

We can also use ALTER USER to change the password before expiration.

SQL> alter user hr identified by welcome1;

User altered.

Where welcome1 is the explicit password, it's case-sensitive with or without double quotation marks.

For more ways to do it, you can also use various GUI tools to change the password.

Defer Expiration

For senior DBA, you may consider to defer user's password expiration.

Sometimes, the expiration notice might be very annoying to users, you may consider to totally avoid ORA-28002 password expiration notice.

2 thoughts on “How to Resolve ORA-28002: the password will expire within 7 days”

Leave a Reply

Your email address will not be published. Required fields are marked *