A sap hana user is created with a life span of 182 days by default. The message "The password for database user < user name > will expire on 2018-07-17 at 15:17:35" .If the password expires, the user will be locked.] will be triggered every day in hana studio during the 14 days before the dead line.

The user will then be locked after the expiring date. In order to re-activate the user again, 2 actions will then be required. You will have to unlock the user as well as to give the user a new password.

There are 2 solutions to update the password expiration date before the fatal date.

On one hand, just update the user password with a new password and the expiring date will be rescheduled for 182 days. This is the advisable procedure for any standard and personal user accounts.

On the other hand, if your user is a technical user, the best thing to do is to disable the expiring date as you do not want this user to be locked in the future. Here is the command to de-activate or to re-activate the password lifetime:

 

ALTER USER < username > DISABLE PASSWORD LIFETIME;

ALTER USER < username > ENABLE PASSWORD LIFETIME;

 

Here is an SQL script to disable or enable the default user password date limit. The anonymous block code can be integrated into a stored procedure.

 

do begin

declare LV_USERNAME varchar(50) := 'PAUL'; -- To be changed
declare LV_USERPASS varchar(50) := 'Paul20180714'; -- To be changed
declare LV_SQL varchar(200);
declare LV_ACTION varchar(20) := 'DISABLE'; -- Values : DISABLE or ENABLE -- To be changed
declare LV_STANDARD_USER varchar(3) := 'NO'; -- To be changed

IF (:LV_STANDARD_USER <> 'YES') THEN
-- solution 1 : Disable time limit or re-activate it
----------------------------------------------------- For technical users. For automatic batch, procedure access reasons.
LV_SQL := 'ALTER USER '||LV_USERNAME||' '||LV_ACTION||' PASSWORD LIFETIME';
ELSE
-- solution 2 : Update the user password
----------------------------------------------------- For standard personal users. For security reason.
LV_SQL := 'ALTER USER '||LV_USERNAME||' PASSWORD '||LV_USERPASS;
END IF;

EXEC(:LV_SQL);

Select user_name, PASSWORD_CHANGE_TIME, LAST_PASSWORD_CHANGE_TIME, LV_SQL||' ' as WhatWasDone
from users
where user_name = 'PAUL';

END

 

 

Source: http://www.bestsaphanatraining.com/how-to-update-user-password-expiration-date-in-sap-hana-t6.html