matinal:SAP用户帐号密码通过一个已知帐号密码去修改

2023-10-13 18:28:49 浏览数 (1)

SAP用户帐号密码通过一个已知帐号密码去修改 由于存在HASH,所以需要将多个字段同步修改,否则仍然会报密码错误。 经测试,需修改以下字段。

代码语言:javascript复制
update sapqas.usr02 set BCODE= (select  BCODE   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set PWDSALTEDHASH  = (select  PWDSALTEDHASH   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set PASSCODE= (select  PASSCODE  from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set PWDLOCKDATE= (select  PWDLOCKDATE  from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set UFLAG = (select  UFLAG   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set ERDAT= (select  ERDAT   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set TRDAT = (select  TRDAT    from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set LTIME= (select  LTIME  from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set PWDLGNDATE= (select  PWDLGNDATE   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'

经多方测试最终只需要同步以下三个字段即可

代码语言:javascript复制
update sapqas.usr02 set pwdchgdate = (select  pwdchgdate   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set pwdsetdate  = (select  pwdsetdate   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'
update sapqas.usr02 set PWDSALTEDHASH  = (select  PWDSALTEDHASH   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'

最终代码简化为:

代码语言:javascript复制
update sapqas.usr02 set (pwdchgdate,pwdsetdate,PWDSALTEDHASH)  = (select  pwdchgdate,pwdsetdate,PWDSALTEDHASH   from sapqas.usr02 where mandt = 600 and bname = 'TEST' ) where mandt = 550 and bname = 'TEST'

0 人点赞