Home All Groups Group Topic Archive Search About
Author
3 Apr 2006 2:28 PM
micah.fox
I am trying to set up a WMI alert on SQL Server 2005 as described in
the article,
http://www.microsoft.com/technet/prodtechnol/sql/2005/evaluate/newsqlagent.mspx.

I try running the following:

USE [msdb]
GO
EXEC msdb.dbo.sp_add_alert @name=N'Database Created',
        @enabled=1,
        @delay_between_responses=0,
        @include_event_description_in=0,
        @wmi_namespace=N'\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER',

        @wmi_query=N'SELECT * FROM CREATE_DATABASE',
        @job_id=N'00000000-0000-0000-0000-000000000000'
GO

This produces:

"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."

Any ideas??

Author
3 Apr 2006 7:30 PM
micah.fox
bump
Author
4 Apr 2006 1:13 AM
Ciprian Gerea [MSFT]
You can use wbemtest.exe to troubleshoot your query. Connect to that
namespace (\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER) and then
issue the notification query (select ...).

One of the two things can go wrong when you get this error message: either
the server is not the default instance, in which case you won't be able to
connect, or the event name is wrong, which is not the case here.

--
Ciprian Gerea
SDE, SqlServer

This posting is provided "AS IS" with no warranties, and confers no rights.


<micah.***@sas.com> wrote in message
Show quote
news:1144074535.128899.40160@v46g2000cwv.googlegroups.com...
>I am trying to set up a WMI alert on SQL Server 2005 as described in
> the article,
> http://www.microsoft.com/technet/prodtechnol/sql/2005/evaluate/newsqlagent.mspx.
>
> I try running the following:
>
> USE [msdb]
> GO
> EXEC msdb.dbo.sp_add_alert @name=N'Database Created',
> @enabled=1,
> @delay_between_responses=0,
> @include_event_description_in=0,
> @wmi_namespace=N'\\.\root\Microsoft\SqlServer\ServerEvents\MSSQLSERVER',
>
> @wmi_query=N'SELECT * FROM CREATE_DATABASE',
> @job_id=N'00000000-0000-0000-0000-000000000000'
> GO
>
> This produces:
>
> "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."
>
> Any ideas??
>
Author
4 Apr 2006 4:31 PM
Micah
Thanks for the reply.

I ran wbemtest.exe and was able to connect to the name space without
any problems.  I am using the default instance, so that shouldn't be
the problem.  However, I am still getting this error.

Could it be some sort of permissions issue?
Author
5 Apr 2006 1:08 AM
Ciprian Gerea [MSFT]
Yes, one of the reasons for which this fails is lack of permissions. You can
verify this by running wbemtest under the credentials of the agent account,
and see if you can get through.

--
Ciprian Gerea
SDE, SqlServer

This posting is provided "AS IS" with no warranties, and confers no rights.


Show quote
"Micah" <micah.***@sas.com> wrote in message
news:1144168292.134865.280120@z34g2000cwc.googlegroups.com...
> Thanks for the reply.
>
> I ran wbemtest.exe and was able to connect to the name space without
> any problems.  I am using the default instance, so that shouldn't be
> the problem.  However, I am still getting this error.
>
> Could it be some sort of permissions issue?
>
Author
7 Apr 2006 7:54 PM
Micah
After many installs on a VM machine, I have come to this.  After
installing SQL Server, I can set up WMI alerts with no problem.  This
error occurs after I move the msdb database.  The SQL Server account
has full control of the directory the data and log files are in.  Any
thoughts?

AddThis Social Bookmark Button