SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Update stats process not getting killed


Update stats process not getting killed

Author
Message
savethytrees
savethytrees
SSC Veteran
SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)

Group: General Forum Members
Points: 218 Visits: 680
Windows server 2003
SQL Server 2000 enterprise edition. 32 bit.

Hi,
I have set up a maintenance plan to update stats. Unfortunately I picked 100% sampling to update the stats. Last weekend, the job to run the maintenance plan got kicked off and I started to get blocking issues because of this. The update stats command was blocking other queries.

So I first stopped the job but the SPID that was running update stats kept running. I tried to kill the SPID and it kept on running. I verified that it was in a roll back state. But as soon as it rolled back update stats on one table, it started to update stats on the next table.

So in spite of stopping the job and killing SPID several times the process to update stats kept running and finally after 35 hrs it finished with an error.
I could have restarted the instance to get rid of it but didn't want to take a risk as it was no longer causing blocking.

Has anyone else seen this behaviour or knows how to kill a SPID?

Blog
http://saveadba.blogspot.com/
EdwardLawton
EdwardLawton
Grasshopper
Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)Grasshopper (21 reputation)

Group: General Forum Members
Points: 21 Visits: 723
For SQL 2008, here is what we do:

ALTER DATABASE [XXX] SET AUTO_UPDATE_STATISTICS OFF WITH ROLLBACK IMMEDIATE
ALTER DATABASE [XX] SET AUTO_UPDATE_STATISTICS_ASYNC OFF WITH ROLLBACK IMMEDIATE


select Q.job_id,Q.database_id,Q.in_progress from sys.dm_exec_background_job_queue Q
where Q.in_progress = 1 AND Q.database_id = 9
There is then a function called KILL STATS JOB Y
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search