cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Query to Delete SAP* user DB level

Former Member
0 Kudos

Hi Everyone,

please tell me the SQL Querry to delete a User SAP* from the Table. so that, i can login SAP* using default password PASSS. Because, my SAP* user is locked due 2 incorrect password. i dont have anyother User id in the Particular Client.

please help me out to resolve it.

Thanks&Regards,

Siva

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

delete from <DBSID>.<schema>.usr02 where BNAME = 'SAP*' and MANDT 'XXX'.

Excample ERP 6.7 SID = DEM running MSSQL DB

Connect Enterprise Manager and on DBSID right klick execute new query

delete from DEM.dem.usr02 where BNAME = 'SAP*' and MANDT 'XXX'.

JPReyes
Active Contributor
0 Kudos

You can use,

Delete from usr02 where bname = 'SAP*' and mandt = 'XXX';

make sure that login/no_automatic_user_sapstar is set to 1

then logon as SAP* password pass

Regards

Juan

former_member185031
Active Contributor
0 Kudos
make sure that login/no_automatic_user_sapstar is set to 1

login/no_automatic_user_sapstar should be 0

Regards,

Subhash

JPReyes
Active Contributor
0 Kudos

Thanks for the correction... value should be 0, don't forget to set it back to 1 when you're done

Regards

Juan

Former Member
0 Kudos

when i execute the Query i am getting this Error:

Msg 208, Level 16, State 1, Line 1

Invalid object name 'usr02'.

Regards,

Siva

Former Member
0 Kudos

siva give it as <sid>.usr02

Rohit

former_member185031
Active Contributor
0 Kudos

Use scema name SAPSR3.USR02 if you are not connected to SAPSR3

Regards,

Subhash

Former Member
0 Kudos

Rohit, i did that also,

Error is:

Msg 208, Level 16, State 1, Line 1

Invalid object name 'SIL.usr02'.

Former Member
0 Kudos

Please use with schema SAPR3 or SAPSR3 as version, like this:

SQL> select UFLAG from SAPR3.USR02 where MANDT=000 and BNAME='DDIC';

UFLAG

-


0

SQL>

so include table name with schema in below command

Delete from usr02 where bname = 'SAP*' and mandt = 'XXX';

thanks

Bhudev

Former Member
0 Kudos

what is this, Schema SAPSR3/SPAr3?

i tried that aswell.

select UFLAG from SAPR3.USR02 where MANDT= 800 and BNAME='SAP*;

Error is:

Msg 208, Level 16, State 1, Line 1

Invalid object name 'SAPSR3.USR02'.

JPReyes
Active Contributor
0 Kudos

Whats your SAP version?...

Former Member
0 Kudos

ECC 6.0

MYSQL 2005

WIndows 2003 server

JPReyes
Active Contributor
0 Kudos

it should be,

delete sapsr3.usr02 where mandt='<client>'and bname='SAP*';

Regards

Juan

Former Member
0 Kudos

Even this,

delete sapsr3.usr02 where mandt='800' and bname='SAP*';

Gives Error:

Msg 208, Level 16, State 1, Line 1

Invalid object name 'sapsr3.usr02'.

Former Member
0 Kudos

then use SAPR3

Former Member
0 Kudos

confusion,

i think, you are not giving the command in one go but pressing backspaces

acc to ecc version, give schema, but type correctly, sometimes it happens, command doenst run after using backspaces

Former Member
0 Kudos

Hi,

I think your command is not correct..

delete from sapsr3.usr02 where bname = 'SAP*' and mandt = '800';

make sure that the value of login/no_automatic_user_sapstar parameter is 0

Hope this should work now..

Rgds,

JP.

Former Member
0 Kudos

its done. thanks for all your support

Former Member
0 Kudos

dude can u tell me hw did u get this right?? i am stuck into same situation

Former Member
0 Kudos

Hi,

First connect to the user SAPSR3

>conn SAPSR3/<password>

>delete from usr02 where bname='SAP*' and mandt='XXX;

>commit;

without commit it will not work.

Thanks,

Pavan

former_member185031
Active Contributor
0 Kudos

Please search the SQL query in SDN and you will find it.

Please search before posting.

Regards,

Subhash