|
|
|
date: Fri, 3 Jul 2009 09:39:55 +0100,
group: microsoft.public.sqlserver.server
back
Re: ID large queries while they execute and kill
Scott (nospam123@yahoo.co.uk) writes:
> Im having a problem with large read queries initiated by end users causing
> problems with my write times.
>
> i would like to understand how to ID the query while its running and kill
> it.
>
> I use profiler and i see the query after its executed but how do i ID a
> process thats causing the problem while its running ?
To start with, what problem are they causing? Blocking or just too much
load on the server? You say they they cause problem with your write times,
which makes me think that blocking is the issue.
In either case, my gut reaction is that killing other users, may not be
the best solution. After all, the users may have submitted these queries,
because they wanted the results from them. Of course, it is not
inconceivable that the users write their queries incorrectly, but
nevertheless.
If the issue is blocking, and you have SQL 2005 or later, you should
consider enabling READ COMMITTED SNAPSHOT ISOLATION, to prevent readers
from blocking writers.
If the issue is just an overall excess in resource consumption, running
sp_who2 a couple of times, and paying attention to the delta in the CPU
and DiskIO columns should help.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
date: Fri, 03 Jul 2009 02:54:55 -0700
author: Erland Sommarskog
|
|