November 30, 2016 at 10:05 am
SQL server got shutdown caused by tempdb maxing out, how can I trace what\who was running at the moment ? Any help would be appropriated.
November 30, 2016 at 10:29 am
i'd say look at the SQL server error log first. see exactly what time, and what errors occurred. the error might point to something obvious.
compare that to your job schedules; are you doing backups or re-indexing or update statistics or checkDB (or all of the above at the same time)
during that same time slot?
how about massive ETL packages? anything running before that tempdb bloat that might eat a ton of disk?
Lowell
November 30, 2016 at 10:37 am
Everything Lowell says, plus check the system_health extended event session. It captures a whole bunch of behaviors, errors, etc., that aren't normally in the log. It could help identify the culprit.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 30, 2016 at 10:55 am
Thanks for reply Lowell.
Yes, I have checked the Error logs and did find out the reason SQL Server was shutdown i.e.
--Date11/30/2016 8:00:55 AM
--Message
--Could not allocate space for object 'dbo.SORT temporary run storage: 140739788865536'
--in database 'tempdb' because the 'PRIMARY' filegroup is full. Create disk space by
--deleting unneeded files, dropping objects in the filegroup, adding additional files
--to the filegroup, or setting autogrowth on for existing files in the filegroup.
Any DMV queries you can provide me to find out, what was running at the moment .
November 30, 2016 at 11:34 am
typically something like this is due to an automated process, combined with not a lot of available disk space.
the dmv's will not be any help, as they are really run time stats, not historical stop reasons.
I'd circle back at looking at scheduled jobs; failed jobs at that time would be what i'd look for first thing.
i've seen things like multiple things launching at exactly 4am(backup + reindex +updatestatistics) bloat my server like that, for example...scheduling them so they don't all launch at the same time was the easy fix
Lowell
November 30, 2016 at 12:07 pm
If I had a nickel for every client I have come across over the past two decades that had umpteen SQL Agent or other batch jobs starting at the same time I would be living on my own private island - like Hawaii!! :w00t:
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 1, 2016 at 1:03 pm
Runaway processes usually cause out of space conditions.
I have never heard of SQL Server shutting down because of that though.
December 2, 2016 at 5:36 am
I would try the default trace, if your qucik enough you may get some information of what caused the files to grow and at what time.
December 2, 2016 at 6:48 am
Talib123 (12/2/2016)
I would try the default trace, if your qucik enough you may get some information of what caused the files to grow and at what time.
The system_health extended event session has everything the default trace has and more.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 2, 2016 at 7:05 am
OK Grant, I might finally start looking @Extend Events.
I have been avoiding it. Wish me luck.
December 2, 2016 at 7:21 am
Talib123 (12/2/2016)
OK Grant, I might finally start looking @Extend Events.I have been avoiding it. Wish me luck.
Ha!
It's not that bad. Erin Stellato has a bunch of blog posts on getting started and making the switch from Trace. Jonathon Kehayias has tons of articles on it too. I've posted a few to my blog as well. The GUI is a little bit of a mess, but once you get used to it, you're going to love all the added functionality.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
December 2, 2016 at 3:07 pm
Talib123 (12/2/2016)
OK Grant, I might finally start looking @Extend Events.I have been avoiding it. Wish me luck.
Don't feel bad. I have been consulting on SQL Server for 20+ years now and I think I have used an Extended Event in anger once. 😎
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 3, 2016 at 7:16 am
Grant Fritchey (12/2/2016)
Talib123 (12/2/2016)
I would try the default trace, if your qucik enough you may get some information of what caused the files to grow and at what time.The system_health extended event session has everything the default trace has and more.
Will it display the SQL code that is causing TempDB to grow?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 3, 2016 at 7:22 am
LearnSQL!!! (11/30/2016)
SQL server got shutdown caused by tempdb maxing out, how can I trace what\who was running at the moment ? Any help would be appropriated.
Correct identification of the problem is 90% of the solution. I recommend that you set TempDB back to whatever "normal" is for you and then setup an alert that not only tells you that growth has reached some threshold but also identifies the likely culprits in code.
The following post seems to provide a fairly easy method to do that.
https://www.mssqltips.com/sqlservertip/3276/sql-server-alert-for-tempdb-growing-out-of-control/
--Jeff Moden
Change is inevitable... Change for the better is not.
December 4, 2016 at 3:53 am
Jeff Moden (12/3/2016)
Grant Fritchey (12/2/2016)
Talib123 (12/2/2016)
I would try the default trace, if your qucik enough you may get some information of what caused the files to grow and at what time.The system_health extended event session has everything the default trace has and more.
Will it display the SQL code that is causing TempDB to grow?
Not directly. You can read more about it here. However if there were processes that had waits beyond 15 seconds on latches or 30 seconds on locks (and tempdb might be in that), it records them.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply