Tuesday, October 20, 2009

0x8000ffff Login failed for user 'DOMAIN\SAPServiceSID'...

While uninstalling/reinstalling an SRM 7.0 test system, I came across this error in the work process trace file after the SAP system failed to start before post-processing of the install. This was fairly common on Windows/SQL Server systems in the Pre-ECC world and I thought maybe a few new guys would not know how to address this. Basically it is a prblem with the Windows user and SQL Server login not matching up correctly or being mapped together just right. Here is the process I follow to correct this problem, if a simple shutdown-restart of Windows does not fix it:

(Please read through all the steps to make sure you know what you are doing before starting)

- First, make sure that the affected SAP system is completely shut down (the error will only stop the dispatcher, but the other processes may still be running) and stop the SAPSID_xx service. You may have to set the service to "disabled" to keep it from starting up again while you go through the rest of the steps.

- Second, go into SQL Server Enterprise Manager (or Management Studio, depending on what version you are running) and delete the database user DOMAIN\SAPServiceSID (under the database [SID] > Security > users).

- Third, delete the SQL Server Login DOMAIN\SAPServiceSID (don't confuse this with the database user which should already be deleted at this point). It is VERY IMPORTANT that you only remove the SQL Server Login AFTER you have deleted the database user, otherwise you will have to go through another process later to synchronize the database user with the SQL Server login.

- Fourth, create the DOMAIN\SAPServiceSID login for SQL Server with the following attributes:
  1. Windows Authentication
  2. Default Database: SID (your SAP database)
  3. Server Roles: 'public' and 'sysadmin'
  4. User Mapping: SID as DOMAIN\SAPServiceSID, default schema 'dbo', with database role membership in 'public' and 'db_owner'
  5. Status: Grant 'connect' and enable login
- Fifth, start the SAPSID_xx service (you may need to set it back to 'automatic' if you disable it earlier)

- Sixth, start SAP

If you miss a few of the steps here or the SAPSID_xx service starts back up before you are finished with each step, you may get a 'login not associated with trusted SQL Server connection' error. In this case, you will just need to stop/restart the SAPSID_xx service again after completing all steps.

Hope this helps...