The administrator can “activate / deactivate” a user account with the following SQL command or SQL console of the SAP HANA studio, the only prerequisite is, you need to have system privilege “USER ADMIN”.
We can use the following SQL query to DEACTIVATE HANA DB user ;
ALTER USER <user_name> DEACTIVATE USER NOW;
Example ;
alter user SAPBASISINFO deactivate user now;
We can list the deactivated user with following queries ;
select * from users where user_deactivated= ‘TRUE’;
or
select * from “SYS”.”USERS” where user_deactivated=’TRUE’;
We can list the output according to deactivated user ;
select * from users where user_deactivated= ‘TRUE’ and user_name=’SAPBASISINFO’;
To activate the user again we can use the below SQL query ;
ALTER USER <user_name> ACTIVATE USER NOW;
Example ;
alter user SAPBASISINFO activate user now;