cancel
Showing results for 
Search instead for 
Did you mean: 

How to lock user through Command prompt level

Former Member
0 Kudos

hi experts,

i am using 4.7 ides with orcale 8i & want to lock user through command promat level.

i had install data base in D drive..& OS in C drive

i am using following steps and getting problem plz guide me

go to command proamt

then SQLPLUS

then SYSTEM/MANAGER AS SYSDBA

then in SQL> UPDATE USR02 SET UFLAG='64' WHERE BNAME='user id' & MANDT='client no'

then SQL>commit

but it shows only 2

what is this ......

how can i use it.

is there anyone who can slove this problem.

plz help me out.

regards

anuj

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

thanks a lot all of u

Former Member
0 Kudos

After you finish creating this script and getting it to update the db successfully, you'd still have another problem. The table USR02 is buffered which means after you update it via DB back-end, the data may not be updated in the SAP buffers. The SAP user will remain locked and unable to login for a period of time.

You can always manually run /$sync in SAP, but if you are going to do that in the first place - why not just run SU01 to unlock the user?

Former Member
0 Kudos

i suggest using tp command to do this

tp locksys <sid>

command will lock all the users except sap* and ddic

Samrat

Former Member
0 Kudos

Dear Anuj,

Please find the below steps to lock the users in database level(command level),easiest way would be to write a sqlplus command that sets the UFLAG field in table USR02 to 64 EXCEPT for the BNAMEs you don't want locked. When you are done, you can do the same again but change the UFLAG field to 0.

The SQL statement would look like:

update SAPR3.USR02 set UFLAG = 64 where MANDT = <client number> and BNAME != <don't lock user 1>

AND BNAME != <don't lock user 2>;

You can replace != with < > if you want ,run this from an OS command line.

When users are locked, the uflag is set to 64.

so you can try with query to check.:

select bname, uflag from sapr3.usr02 where mandt=<client number>;

Thanks

Kishore

Edited by: Kishore Kumar Tenkayala on Aug 5, 2008 2:18 PM

Former Member
0 Kudos

Hi,

Try same sql statement followed by

;

i.e.

UPDATE USR02 SET UFLAG='64' WHERE BNAME='user id' & MANDT='client no';

Commit;

Thanks,

Shambo