Stop SQL trace and deadlock trace for MSSQL Server Monitoring

Community post

Shared by the Applicare community. It has not been re-checked against Applicare 10.0, so confirm the steps in your environment or contact Support.

Stop the MSSQL Applicare Agent and follow the below steps.

Step 1: Login into MSSQL Server with 'sa' or Applicare User. The user should have sysadmin permission.

[Screenshot 1 is not available on this page.]

Step 2: Select "New Query" and "master" database.

[Screenshot 2 is not available on this page.]

Step 3: To view the traces enter the below sql and click execute. select * from sys.traces;

[Screenshot 3 is not available on this page.]

Step 4: For every MSSQL Server agent two traces will be running for Applicare.

  • SQL data gather (Maximum 512 MB).
  • Deadlock data gather (Maximum 10 MB).

Once it reaches its maximum size it will reset itself. So it will not go beyond their maximum limit.

Expand the path column. If it is a Applicare Trace then in the path column it will have the Applicare Home directory and at last it will end with SQLTraceProfiling.trc and SQLDeadlockTraceProfiling.trc.

[Screenshot 4 is not available on this page.]

Step 5: In the trace results note the 'id' value of the Applicare traces and execute the below two SQL's one by one.

sp_trace_setstatus @traceid , 0

sp_trace_setstatus @traceid , 2

Replace the @traceid with the id value of Applicare trace.

For Example from the above result

SQLDeadLockTraceProfiling.trc id is 2. So replacing the @traceid with 2 and executing the below queries one by one.

sp_trace_setstatus 2 , 0

sp_trace_setstatus 2 , 2

[Screenshot 5 is not available on this page.]

SQLTraceProfiling.trc id is 3. So replacing the @traceid with 3 and executing the below queries one by one.

sp_trace_setstatus 3 , 0

sp_trace_setstatus 3 , 2

[Screenshot 6 is not available on this page.]

Step 6: Now the traces will be stopped and removed from the SQL server. To verify that execute the below query and check. The Applicare trace entries should not be there in the result.

[Screenshot 7 is not available on this page.]

Step 7: Now go to the MSSQL Agent home directory and delete the two trace files. It will be inside <ApplicareAgentHomeDirectory>

[Screenshot 8 is not available on this page.]

Join the discussion

Comments, voting and following are kept by Zendesk and need a Help Center account. This button opens the original discussion there.

Opens Zendesk · needs internet and sign-in

Still stuck? Contact support