Error in WMI Event Alert for DB Mirroring

  • Hi,

    I am trying to create an WMI Event alert on MS SQL Server 2008 R2 (RTM) std edition. I have default MSSQLSERVER instance available on the DB Server.

    I want to create the alert to notify when automatic failover happens, i am getting the following error :

    SQLServerAgent Error: WMI error: 0x80041003.

    The @wmi_query could not be executed in the @wmi_namespace provided. Verify that an event class selected in the query exists in the namespace and that the query has the correct syntax. (Microsoft SQL Server, Error: 22022)

    when i am trying through T-SQL:

    EXEC msdb.dbo.sp_add_alert

    @name=N'DB Mirroring: State Changes',

    @category_name=N'Database Mirroring',

    @wmi_namespace=N'\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER',

    @wmi_query=N'SELECT * from DATABASE_MIRRORING_STATE_CHANGE WHERE State = 8',

    @enabled=1

    Getting the error :

    Msg 14262, Level 16, State 1, Procedure sp_verify_alert, Line 245

    The specified @category_name ('Database Mirroring') does not exist.

    Kindly suggest possible workaround/resolution for the same.

    Thanks & regards,

    Animesh

  • from what I remember 0x80041003 is an insufficient permissions error, cant remember if its insufficient at the agent level to run the alert or to your account creating the alert.

    one thing I would say is set the agent alert properties to replace tokens.

  • Hi Anthony,

    Permission in place at the Agent level, Agent is running under a domain user having the permission.

    I have also checked by enabling the token replacement in Agent Alert properties.

    Thanks in advance for any further input on this.

  • do you or the agent account have the correct Windows Server access rights to query WMI data

  • What do you get when you run this:

    msdb.dbo.sp_help_category @class = 'Alert'

  • Hi,

    I am getting the following result

    983[Uncategorized]

    203Replication

    apologies for delay in reply.

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply