ORA-28002: the password will expire within 0 days
Cause: The user’s account is about to expire and the password needs to be changed.
Action: Change the password or contact the database administrator.
Reasons:-
This happen when you have not change password in Password_life_time value of the profile set into
your account and you have entered into PASSWORD_GRACE_TIME value.
[oracle@ora-dev ~]$ sqlplus system/manager@DEV
ERROR:
ORA-28002: the password will expire within 0 days
Connected to:
Oracle Database 12c EE High Perf Release 12.2.0.1.0 - 64bit Production
SQL> select username, account_status, EXPIRY_DATE from dba_users where username='SYSTEM';
USERNAME ACCOUNT_STATUS EXPIRY_DATE
-------------------------------- -------------------
SYSTEM OPEN 1986-10-11 09:33:28
SQL> select profile from DBA_USERS where username = 'SYSTEM';
PROFILE
--------------------------------------------------------------------------------
DEFAULT
SQL>
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'); 2 3
LIMIT RESOURCE_NAME
--------------------------------
180 PASSWORD_LIFE_TIME
UNLIMITED PASSWORD_REUSE_TIME
UNLIMITED PASSWORD_REUSE_MAX
7 PASSWORD_GRACE_TIME
SQL>
SQL> alter profile DEFAULT limit PASSWORD_LIFE_TIME unlimited;
Profile altered.
SQL> commit;
Commit complete.
SQL> ALTER PROFILE DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS 100 PASSWORD_LOCK_TIME 100;
Profile altered.
SQL> ALTER PROFILE DEFAULT LIMIT PASSWORD_GRACE_TIME 100;
Profile altered.
SQL> commit;
Commit complete.
SQL>
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
100 PASSWORD_GRACE_TIME
SQL>
SELECT * FROM dba_profiles WHERE profile = 'DEFAULT' AND resource_type = 'PASSWORD';
DEFAULT FAILED_LOGIN_ATTEMPTS PASSWORD 100 NO NO NO
DEFAULT PASSWORD_LIFE_TIME PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_REUSE_TIME PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_REUSE_MAX PASSWORD UNLIMITED NO NO NO
DEFAULT PASSWORD_VERIFY_FUNCTION PASSWORD NULL NO NO NO
DEFAULT PASSWORD_LOCK_TIME PASSWORD 100 NO NO NO
DEFAULT PASSWORD_GRACE_TIME PASSWORD 100 NO NO NO
DEFAULT INACTIVE_ACCOUNT_TIME PASSWORD UNLIMITED NO NO NO
SQL> alter user system identified by DElhi##2021;
User altered.
SQL> commit;
Commit complete.
SQL>