Click here to monitor SSC
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
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 484
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-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47191 Visits: 44358
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
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 484
Tempdb has 30GB drive and it ran out of space.
So i had to shrink the tempdb database.
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44994 Visits: 39880
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.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
psred
psred
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 484
How to find the queries thats causing tempdb fill very often.
Erland Sommarskog
Erland Sommarskog
SSC Eights!
SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)SSC Eights! (931 reputation)

Group: General Forum Members
Points: 931 Visits: 866
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-Forever
SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)SSC-Forever (44K reputation)

Group: General Forum Members
Points: 44994 Visits: 39880
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.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
psred
psred
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 484
Thank you all.
Jack Corbett
  Jack Corbett
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11014 Visits: 14858
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
Valued Member
Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)Valued Member (50 reputation)

Group: General Forum Members
Points: 50 Visits: 484
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