I made it work using the driver SQL Server
(ODBC 13 and 17 didn't work)
(I didn't try SQL Server Native 11)
I think you must provide NT Authority\System the permissions to the database
if using it on the Performance Monitor side.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi All,
(Apologies if this is in the wrong place - it's not that easy to find/select a right one!!)
I'm using Performance Monitor to collect CPU usage stats from the server.
There's no issue writing to a csv file and I have a monitor running 24/7 doing that.
However, if I select SQL for the output I get "When attempting to start the Data Collector Set the following system error ocurred: Call to SQLExecDirect failed with %1".
I can see through SSMS and a profiler trace that it creates three tables in the target database - CounterData, CounterDetails and DisplayToID.
It then runs "exec sp_tableoption 'CounterData', 'table lock on bulk load', true" and "select GUID, RunID, NumberOfRecords from DisplayToID where DisplayString = 'DataCollector01'" before logging out.
All three tables are empty.
This is running (or trying to) on Server 2016 Datacenter (10.0.14393), SQL Server 2019 CU18, ODBC Driver 17 for SQL Server (2017.177.02.01)
Any help gratefully received.
Thanks,
Paul.
I made it work using the driver SQL Server
(ODBC 13 and 17 didn't work)
(I didn't try SQL Server Native 11)
I think you must provide NT Authority\System the permissions to the database
if using it on the Performance Monitor side.
So I tried it myself and luckily I was able to regenerate the issue and fix it.
Here is what I did:
I mapped the NT AUTHORITY\SYSTEM server login to the database where I am trying to collect the information.
I then gave it permission one by one before reattempting start of Datacollector from perfmon each time:
Note: The errors related to PDH( one you provided in one of your comments) and different event ids are all due to some missing permissions for the user on the database.
Here is what you need to do:
Note2: Adding the permissions for other users from Data collector > Properties >Security tab was not getting effective for me and only SYSTEM was showing as the account with read write permission which is why I mapped NT AUTHORITY\SYSTEM itself to my test database to collect the data from perfmon.
In short the user needs to have ddladmin for creation of tables, ddl datawriter for writing into tables, ddl datareader to read/select from these tables as minimum permissions only after that data collector will start without throwing any errors.
Ps. The information in the window event viewer application logs was the real helping point in determining the issue for me.
I hope this will help.
Regards,
Shivam
Hi @Paul Cousins ,
In the ODBC system DSN configuration on the SQL Server, click the "Client Configuration" and make sure the "Dynamically determine port" is not checked
And also be sure to use Windows Authentication, in SSMS, add NT Authority\SYSTEM as a Windows login and make sure it has write access to the database you have defined in the above ODBC system DSN
You must change "Run as" for your Data Collector Set in performance monitor to your windows user which should have the corresponding rights to the database and belong to the user group
-------------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Try running the data collector with account which has permission to read and write on sql server:
In perfmon> Right-click "Your Data Collector"-> select properties->General->Run As->choose another account which has permissions.
Or, you could give the current user full control permission:
Right-click "Your Data Collector"-> select properties->Security->Group or Users you want to give access->Permissions->Full Control
Regards,
Shivam