Question

I have been told that SQL Profiler makes changes to the MSDB when it is run. Is this true and if so what changes does it make?

MORE INFO

The reason I ask is that we have a DBA who wants us to range a change request when we run the profiler on a live server. Her argument is that it makes changes to the DB's which should be change controlled.

Was it helpful?

Solution

Starting a trace adds a row into msdb.sys.traces, stopping the trace removes the row. However msdb.sys.traces is a view over an internal table valued function and is not backed by any physical storage. To prove this, set msdb to read_only, start a trace, observer the new row in msdb.sys.traces, stop the trace, remember to turn msdb back read_write. Since a trace can be started in the Profiler event when msdb is read only it is clear that normally there is no write into msdb that can occur.

Now before you go and grin to your dba, she is actually right. Profiler traces can pose a significant stress on a live system because the traced events must block until they can generate the trace record. Live, busy, systems may experience blocking on resources of type SQLTRACE_BUFFER_FLUSH, SQLTRACE_LOCK, TRACEWRITE and other. Live traces (profiler) are usualy worse, file traces (sp_trace_create) are better, but still can cause issues. So starting new traces should definetly something that the DBa should be informed about and very carefully considered.

OTHER TIPS

The only ones I know happen when you schedule a trace to gather periodic information - a job is added.

That's not the case as far as I'm aware (other than the trivial change noted by others).

What changes are you referring to?

Nothing I have ever read, heard, or seen says that SQL Profiler or anything it does or uses has any impact on the MSDB database. (SQL Profiler is, essentially, a GUI wrapped around the trace routines.) It is of course possible to configure a specific setup/implementation to do, well, anything, and perhaps that's what someone is thinking of.

This sounds like a kind of "urban legend". I recommend that you challenge it -- get the people who claim it to be true to provide proof.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top