SQL Server Closing Profiler without stop it first

5sxhfpxr  于 2023-08-02  发布在  其他
关注(0)|答案(3)|浏览(113)

Closing Microsoft SQL Profiler without stop it first. By doing that, is it keeping the process alive and affecting the SQL performance?

I am asking this because I am wondering why the utility warns me when I am trying to do so.

qeeaahzv

qeeaahzv1#

For any future references - according to MS https://learn.microsoft.com/en-us/sql/tools/sql-server-profiler/close-a-trace-window-sql-server-profiler closing the trace window stops the associated trace.

smdnsysy

smdnsysy2#

Yes, the trace is still running if you close the tool without stopping it. If you've paused the trace, it's not running, but it still exists on the server. Much cleaner to stop it and clean up after yourself.

In any case, you should try to avoid using Profiler anyway, especially against production . Use a server-side trace , extended events or a 3rd party tool.

uqxowvwt

uqxowvwt3#

As mentioned using Trace is somewhat old-school, slows down the server (depending on what you're tracing), very difficult to pin-point events that are at the crux of your problem, and there are better ways now (post 2012).

I suggest EE, if you don't have SQL Server Enterprise edition (cannot do proper Audits down to table/row level), which was my issue.

https://learn.microsoft.com/en-us/sql/relational-databases/extended-events/quick-start-extended-events-in-sql-server?view=sql-server-ver16

But to answer your question, I am sure closing down SQL Profiler only stops a trace. It doesn't delete it.

You can see what's running by:

--List all SQL Traces 
SELECT * FROM sys.traces

And then re-start the trace directly:

EXEC sp_trace_setstatus 2,1 --where '1' is Start, '0' is stop and '2' is delete it

相关问题