ERROR:
ORA-28002: the password will expire within 7 days
ERROR at line 1:
ORA-28007: the password cannot be reused
Solution :-
SQL> select username, account_status, EXPIRY_DATE from dba_users where username='SYSTEM';
SQL> select profile from DBA_USERS where username = 'HR';
SQL> SELECT * FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD';
Next, change the profile limit to unlimited.
SQL> alter profile DEFAULT limit PASSWORD_REUSE_TIME unlimited;
SQL> alter profile DEFAULT limit PASSWORD_REUSE_MAX unlimited;
SQL> alter profile DEFAULT limit PASSWORD_LIFE_TIME unlimited;
SQL> ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS 100 PASSWORD_LOCK_TIME 100;
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_GRACE_TIME unlimited;
-------------------------------------------------------------------------
SQL> alter user HR account lock;
SQL> select USERNAME,ACCOUNT_STATUS,LOCK_DATE,EXPIRY_DATE,LAST_LOGIN from dba_users where USERNAME='HR';
SQL> select LIMIT, RESOURCE_NAME from dba_profiles where RESOURCE_NAME in ('PASSWORD_GRACE_TIME','PASSWORD_LIFE_TIME','PASSWORD_REUSE_MAX','PASSWORD_REUSE_TIME') and PROFILE=(select profile from dba_users where username='SYSTEM');
LIMIT RESOURCE_NAME
UNLIMITED PASSWORD_LIFE_TIME
UNLIMITED PASSWORD_REUSE_TIME
UNLIMITED PASSWORD_REUSE_MAX
UNLIMITED PASSWORD_GRACE_TIME
For development you can disable password policy if no other profile was set (i.e. disable password expiration in default one):
SQL> ALTER PROFILE "DEFAULT" LIMIT PASSWORD_VERIFY_FUNCTION NULL;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
create a new policy and assign that to your users:
SQL> create profile unlimited_password_policy limit password_life_time unlimited;
SQL> alter user <username> profile unlimited_password_policy;
SQL> ALTER PROFILE unlimited_password_policy LIMIT PASSWORD_GRACE_TIME unlimited;