How to List All SAP HANA Users with Their Lock Status

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:
  1. All users in the HANA Systems.
    Select * from "SYS"."USERS";
  1. List deactivated/locked users.
    Select * from "SYS"."USERS" WHERE USER_DEACTIVATED='TRUE';
  1. List unlocked/active users.
    Select * from "SYS"."USERS" WHERE USER_DEACTIVATED='FALSE';
How to list all SAP HANA users with their lock status?

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';

Leave a Comment