Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Other Forums
 ClearTrace Support Forum
 Trace filters
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

3 Posts

Posted - 08/18/2011 :  14:46:00  Show Profile  Reply with Quote
Hi, I was trying to get a trace for just really big reads - 1 GB or realy big writes - 10 MB. It appeared that I was getting a lot in the trace when setting the @MinReads value to 131072 in admin_trace_start. Perhaps filters need to be in a different order? The OR stuff first on duration, reads, cpu, and writes following by AND stuff? If I specify both a MinRead and a MinWrite, I suppose I would want the value for the read even if there were no writes.

-- Duration Filter
IF @MinDuration IS NOT NULL
exec @RC = sp_trace_setfilter @TraceID, 13, 1, 4, @MinDuration

etc (other OR stuff)

exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Profiler' -- AND

exec sp_trace_setfilter @TraceID, 1, 0, 7, N'exec sp_reset_connection' -- AND

I suppose if I wanted Reads > 10000 or Writes > 1000

(fltr col 16) OR (fltr col 17) AND (fltr col 10) AND (fltr col 1)?

I have not used T-SQL to set filters before. The logical AND/OR rules are not obvious to me. I don't see how I would have separate OR or AND groups. For example (reads > 1000 OR writes > 100) AND (cpu > 1000 or duration > 2000).

Starting Member

3 Posts

Posted - 08/18/2011 :  15:15:15  Show Profile  Reply with Quote
While I'm at it, units?

IF @MinDuration IS NOT NULL
PRINT 'Duration Filter: ' + CAST(@MinDuration AS VARCHAR) + ' microseconds'

PRINT 'CPU Filter: ' + CAST(@MinCPU AS VARCHAR) + ' milliseconds'

PRINT 'Reads Filter: ' + CAST(@MinReads AS VARCHAR) + ' pages'

PRINT 'Writes Filter: ' + CAST(@MinWrites AS VARCHAR) + ' pages'
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.79 seconds. Powered By: Snitz Forums 2000