Avatar of marrowyung
marrowyung
 asked on

how to find SQL trace and stop it

how to find SQL trace and stop it as we found someone left created this and ran for months.

this impact our production platform.

I found these link but seems no much information on how to stop it

https://blogs.msdn.microsoft.com/anthonybloesch/2012/12/14/finding-and-stopping-rogue-sql-traces/
https://mssqlwiki.com/2010/04/26/how-to-find-all-the-profiler-traces-running-on-my-sql-server/
Microsoft SQL ServerMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
marrowyung

8/22/2022 - Mon
marrowyung

ASKER
must restart after changing configuration ?
Vitor Montalvão

Did the first query return records?
select T.id as [Id],
       case T.status when 0 then N’stopped’ else N’running’ end as [Status],
       T.path as [Path],
       case T.is_rowset when 0 then N’false’ else N’true’ end as [Rowset],
       case T.is_shutdown when 0 then N’disabled’ else N’enabled’ end as [Shutdown option],
       T.start_time as [Start],
       T.stop_time as [Stop]
from sys.traces as T
where T.is_default <> 1;

Open in new window

dbaSQL

I would think all you really need to do is run sp_who2, and look at the spid where the ProgramName is something like 'SQL Server Profiler'.  Then you look at the HostName  and the Login, and you'll know what workstation it is being run on, and under what login.

EXEC sp_who2
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
marrowyung

ASKER
dbaSQL,

what is who2 don't show this. recall the C2 audit also show nothing but leave the SQL server in non operational state. very low CPU but SQL server very slow.
SOLUTION
dbaSQL

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
marrowyung

ASKER
dbaSQL,

it can't ! just like C2 audit, nothing will be show up and we have to stop it.

it is funny that once I tell some senior management about that, 80% of the trace stopped. and they said nothing and nothing has been turned on.

one of the rest remaining is from Idera SQL DM, it will just give one try each time.
marrowyung

ASKER
how to stop the trace once found ?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Vitor Montalvão

Did you see my comment? Never had a feedback about it.
marrowyung

ASKER
hi victor sorry about that as I am focusing on my google result and I don't feel good yesterday.

yeah I ran that, it is funny to hear that once I told my senior manager, a lot of trace gone ! they keep saying no.

now only one line which shows it is the SQL DM SW from Idera do this ! but this one disappear once the DM SW done getting information from that box..

so that queries now just return one line for us (previously 6 lines), and that line will come in and out from time to time as it is from our DM box which keep monitoring everything.

what I want to know is, if we found one how can we stop it and even disable it forever ?
ASKER CERTIFIED SOLUTION
Vitor Montalvão

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
marrowyung

ASKER
tks all.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
marrowyung

ASKER
sorry holiday here.
marrowyung

ASKER
tks all.