Tags

,


Today I noticed that in one of the Production we were continuously getting the below same error:

The activated proc ‘[dbo].[sp_syspolicy_events_reader]’ running on queue ‘msdb.dbo.syspolicy_event_queue’ output the following:  ‘Cannot execute as the database principal because the principal “##MS_PolicyEventProcessingLogin##” does not exist, this type of principal cannot be impersonated, or you do not have permission.’

I still need to figure out why we were receiving the alerts but solving the issue is quite straightforward. It is an issue as  ##MS_PolicyEventProcessingLogin## account was bad on the msdb database.  To fix this, we need to execute the below code:

USE MSDB
EXEC SP_CHANGE_USERS_LOGIN ‘REPORT’

If it returns the UserName ##MS_PolicyEventProcessingLogin## then we can run AutoFix to re-sync the database user with the instance login. We can use the below command to fix the same:

exec sp_change_users_login ‘AutoFix’, ‘##MS_PolicyEventProcessingLogin##’

After this we stopped receiving the alerts. Hope it helps you .

Cheers,

Subhro Saha

Subhro Saha

Advertisements