SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

DrRandy
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).

DrRandy
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'

IF @MinCPU IS NOT NULL
PRINT 'CPU Filter: ' + CAST(@MinCPU AS VARCHAR) + ' milliseconds'

IF @MinReads IS NOT NULL
PRINT 'Reads Filter: ' + CAST(@MinReads AS VARCHAR) + ' pages'

IF @MinWrites IS NOT NULL
PRINT 'Writes Filter: ' + CAST(@MinWrites AS VARCHAR) + ' pages'
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.05 seconds. Powered By: Snitz Forums 2000