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


Tempdb data file fills up very often


Tempdb data file fills up very often

Author
Message
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 581
Tempdb fills up very often.

tempdb configuration is
name fileid filename filegroup size maxsize growth usage
tempdev 1 N:\Data\tempdb.mdf PRIMARY 29428480 KB Unlimited 10% data only
templog 2 N:\Data\templog.ldf NULL 512 KB Unlimited 10% log only

I want to know why its happening very often and when i try to shrink tempdb it gives me below message.

DBCC SHRINKDATABASE: Page 1:3678552 could not be moved because it is a work table page.

Please suggest what needs to be done to solve the issue.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)SSC Guru (86K reputation)

Group: General Forum Members
Points: 86901 Visits: 45266
Why are you shrinking a file that's already too small for the workload? Surely if the file's getting full all the time you'd want to make it larger, not smaller?

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 581
Tempdb has 30GB drive and it ran out of space.
So i had to shrink the tempdb database.
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85481 Visits: 41081
p.swathi4 (8/17/2013)
Tempdb has 30GB drive and it ran out of space.
So i had to shrink the tempdb database.


TempDB grows to fit the need. For example, it's used for certain types of joins, index and tables spools, and a whole lot of other stuff.

That being said, the "need" might be the problem. If you have queries with accidental many-to-many joins, the "need" will be great to store that data temporarily in TempDB. You need to find such queries and fix them or shrinking TempDB will be to no avail.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 581
How to find the queries thats causing tempdb fill very often.
Erland Sommarskog
Erland Sommarskog
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2111 Visits: 872
p.swathi4 (8/17/2013)
Tempdb has 30GB drive and it ran out of space.
So i had to shrink the tempdb database.


Then you need to find another drive to extend it on.

30 GB is not really a small tempdb, but it not excessive either. All depending on your workload 30 GB may make sense, be too small, or be inflated by one single bad query.

You can find out which processes that are using a lot of tempdb from this DMV: sys.dm_db_task_space_usage

Do you have any databases that uses any form of snapshot isolation? You can see how much space the version store takes up in this DMV: sys.dm_db_file_space_usage.

Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)SSC Guru (85K reputation)

Group: General Forum Members
Points: 85481 Visits: 41081
p.swathi4 (8/17/2013)
How to find the queries thats causing tempdb fill very often.


It's a fairly large subject so you need to ask your assistant DBA the question. In fact, you and I have the same assistant DBA... His first name is "Google". :-D

Seriously... go to Google and type in "find the queries thats causing tempdb fill" (the exact wording of part of your question) and you'll find a lot of posts on the subject.

One of the MS White Papers on the subject has a wealth of data concerning this problem. It also has a method for helping to track down things that are using TempDB the most near the end of the paper. Here's the URL for that.
http://technet.microsoft.com/library/Cc966545#EGAA

As a bit of a sidebar, many people have written queries to attempt to find out what's causing TempDB to grow. I've not tested the query at the following link but it's written someone that I have high regard for.
http://www.sqlservercentral.com/scripts/tempdb/72007/

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 581
Thank you all.
Jack Corbett
  Jack Corbett
SSCoach
SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)SSCoach (18K reputation)

Group: General Forum Members
Points: 18402 Visits: 14893
Something that hasn't been mentioned yet, is that having the autogrow set to 10% isn't usually the best practice and this could be causing the out of space error because a 28GB file is trying to grow another 2.8GB on a drive that is smaller than the required 30.8 GB. In addition to all the other recommendations, I'd recommend setting the data file to the size of the drive, not allow autogrowth, and monitor space available (% used) and have an alert setup that lets you know when you are running out of space.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 581
Can you suggest me the best autogrowth settings on the tempdb files
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