Hello Team,
I have to develop a customized password verify function. The function should address below requirements :
(i) Minimum password age 2 days.
(ii) Forced password reset on first logon of user.
I have got the minimum password age as below :
PROCEDURE p_CheckMinPwdAge ( pUserName IN VARCHAR2)
IS
nDummy Number;
nCount Number;
BEGIN
SELECT COUNT(1) INTO nCount FROM FROM SYS.USER$ WHERE NAME = pUserName;
IF nCount > 0 THEN
SELECT (SYSDATE - PTIME) INTO nDummy FROM SYS.USER$ WHERE NAME = pUserName;
IF nDummy <= 2 THEN
RAISE_APPLICATION_ERROR( -20007, 'Password should be used for atleast 2 days.' );
END IF;
END IF;
END p_CheckMinPwdAge;
We need to implement that the first time when user is created and assigned a password, it should get expired once user logins and after that every password should be used atleast for 2 days.
Please help.