This blog post will teach you how to list all SAP HANA users with their lock status. This can be useful for troubleshooting login issues or for auditing user activity.
- Connect to the required system via HANA Studio
- Open Administration perspective, you can open it from Window -> Open -> Perspective -> Administration Console
- Execute following SQL in SQL console:
- All users in the HANA Systems.
Select * from "SYS"."USERS";
- List deactivated/locked users.
Select * from "SYS"."USERS" WHERE USER_DEACTIVATED='TRUE';
- List unlocked/active users.
Select * from "SYS"."USERS" WHERE USER_DEACTIVATED='FALSE';
These queries are similar to: –Select * from "PUBLIC"."USERS";
Select * from "PUBLIC"."USERS" WHERE USER_DEACTIVATED='TRUE';
Select * from "PUBLIC"."USERS" WHERE USER_DEACTIVATED='FALSE';