Instead of using lock & unlock steps in SAP GUI level, you can also lock the SAP user(s) via Oracle SQL. The locking and unlocking process are depending on the UFLAG status. Please refer to UFLAG value article for details.
Not locked: 16: Lock: 32: Locked by CUA admin (User Admin) 64: Locked by system Administrator: 128: Locked due to incorrect logon attempts or too many failed attempts: 192: A combination of both. The user is locked by admin and user tries to logon with incorrect passwords and gets locked ( 192 = 64+128). If you set the field 'UFLAG'=128, you will get the users that are locked by reason of incorrect logons. 'UFLAG'=64 will give you the users that are blocked by Administrator. 'UFLAG'=0 means that the user is not locked. Dig Deeper on SAP Basis.
Lock User using Oracle SQL
1. Query the BNAME(username), UFLAG, MANDT(client) of the user.
2. Set the UFLAG to 64 to lock the user.
Unlock User using Oracle SQL
How To Check User Lock Status In Sap
![Status Status](/uploads/1/1/8/8/118815396/806284456.jpg)
![Status Status](/uploads/1/1/8/8/118815396/770026124.png)
1. Query the BNAME(username), UFLAG, MANDT(client) of the user.
2. Set the UFLAG to 0 to unlock the user.
Mass Lock & Unlock Users using Oracle SQL
In SAP level, you can use transaction code SU10 to mass lock and unlock users. In Oracle database level, you can use below command to mass lock and unlock SAP users. Below command will be useful if you are doing system upgrade, refresh or copy.
1. Mass Lock. This command will lock all dialog (USTYP=’A’) users except for users (DDIC, SAP*, ARA and ITSITI). You can add or remove any users not to be locked as well.
Sap System Status
2. Mass Unlock.