Tuesday, October 11, 2011

How to unlock any SAP user from Oracle level

First check the Schema user Id from the below command.


$select username, user_id, account_status from dba_users;


normally the schema user id is sapsr3 or sapr3 (in old versions) or sap(sid)

first display the user using below sql:


$select bname, mandt, UFLAG from sapsr3.usr02 where bname='JSINGH' and mandt=300;

The above query will display the UFLAG value for user JSINGH.
UFLAG value 64 means locked due by administrator and 128 means locked due to incorrect logon attempts. Unlocked user will have UFLAG value set to 0.

Now we will set the UFLAG value of user 'JSINGH' to 0 with below sql command:


$update sapsr3.usr02 set UFLAG=64 where bname='JSINGH' and mandt=300;

$commit;

Now try to login at SAP level, your user has been unlocked :)

No comments: