Tuesday, March 20, 2012

check for queries running with parallelism

I want to check for all queries running with parallelism on our sql servers
for a 24 hour period. How can I do so ?
THanksTake a look at http://msdn2.microsoft.com/en-us/library/ms187943.aspx, and
read up on server side traces.
Note that you are warned about the overhead of this particular eventclass -
so it may prove too much of a hit to be running for 24 hours straight.
"Hassan" <hassan@.test.com> wrote in message
news:ub1Y8GKYIHA.1132@.TK2MSFTNGP06.phx.gbl...
>I want to check for all queries running with parallelism on our sql servers
>for a 24 hour period. How can I do so ?
> THanks|||To add on to Will's response about the server side trace, consider
specifying a filter to narrow down the number of events as much as possible.
Unfortunately, a filter can't be specified on the binary data column that
includes the number of CPUs used. Also, consider specifying a trace file
rollover to keep the trace file sizes reasonable if you have a busy server,
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Hassan" <hassan@.test.com> wrote in message
news:ub1Y8GKYIHA.1132@.TK2MSFTNGP06.phx.gbl...
>I want to check for all queries running with parallelism on our sql servers
>for a 24 hour period. How can I do so ?
> THanks|||You can use this but it is built off of the procedure cache. There are
limitations especially if you have have memory bottleneck or plan reuse
issues.
select
qs.sql_handle,
qs.statement_start_offset,
qs.statement_end_offset,
q.dbid,
q.objectid,
q.number,
q.encrypted,
q.text
from sys.dm_exec_query_stats qs
cross apply sys.dm_exec_sql_text(qs.plan_handle) as q
where qs.total_worker_time > qs.total_elapsed_time
http://www.microsoft.com/technet/scriptcenter/scripts/sql/sql2005/default.mspx?mfr=true
--
Jason Massie
www: http://statisticsio.com
rss: http://feeds.feedburner.com/statisticsio
"Hassan" <hassan@.test.com> wrote in message
news:ub1Y8GKYIHA.1132@.TK2MSFTNGP06.phx.gbl...
>I want to check for all queries running with parallelism on our sql servers
>for a 24 hour period. How can I do so ?
> THankssql

No comments:

Post a Comment