Solution for error: ORA-28001: the password has expired

background

A JAVA program throwed out an error that ” java.sql.SQLException: ORA-28001: the password has expired ” when The program was runing.

This error is offen caused by an expired password of a certain account. therefore oracle system locked the account due to security reason.

To validate guess. I executed following command

SQL>select * from dba_profiles where profile=’DEFAULT’ and resource_name=’PASSWORD_LIFE_TIME’;
PROFILE RESOURCE_NAME RESOURCE LIMITDEFAULT PASSWORD_LIFE_TIME PASSWORD 180

It’s definitely that the limit time of password is 180 days therefore I decided to cancel the time limit of this account. But before performing cancel operation,I need to figure out which account is used to connect oracle database by the program thus I checked jdbc and odm file.

Three Solutions for this problem

1.Unlock account A

Suppose the account is A and it’s password is 123. Just execute the following comand.

SQL> alter user A identified by 123 account unlock;
user altered.

2.Retset password of account A

SQL>ALTER USER A IDENTIFIED BY 1234;
SQL>ALTER USER A IDENTIFIED BY 123;

3.The last way is to modify vaild time to unlimited

It’s unecessary to restart database service after this operation;

(1).Check profile filed value of dba_users tables, In general,profile of this user is “DEFAULT”


SELECT username,PROFILE FROM dba_users;

(2).Check PASSWORD_LIFE_TIME of profile,for example “DEFAULT”.


SELECT * FROM dba_profiles s WHERE s.profile=’DEFAULT’ AND resource_name=’PASSWORD_LIFE_TIME’;

(3).Modify value of “PASSWORD_LIFE_TIME” to unlimited.

ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;

There was no related error of “ORA-28001: the password has expired” after I unlock this account. So this problem had been worked out.

Leave a Reply