Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 1234»»»

Tempdb data file fills up very often Expand / Collapse
Author
Message
Posted Saturday, August 17, 2013 1:55 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 10:32 AM
Points: 22, Visits: 319
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.
Post #1485517
Posted Saturday, August 17, 2013 2:44 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 42,438, Visits: 35,493
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 2008, MVP
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

Post #1485520
Posted Saturday, August 17, 2013 3:03 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 10:32 AM
Points: 22, Visits: 319
Tempdb has 30GB drive and it ran out of space.
So i had to shrink the tempdb database.
Post #1485522
Posted Saturday, August 17, 2013 3:12 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:19 PM
Points: 36,724, Visits: 31,173
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1485523
Posted Saturday, August 17, 2013 3:16 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 10:32 AM
Points: 22, Visits: 319
How to find the queries thats causing tempdb fill very often.
Post #1485525
Posted Saturday, August 17, 2013 4:10 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 2:28 PM
Points: 786, Visits: 691
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
Post #1485527
Posted Saturday, August 17, 2013 4:38 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 11:19 PM
Points: 36,724, Visits: 31,173
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".

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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1485533
Posted Monday, August 19, 2013 8:28 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 10:32 AM
Points: 22, Visits: 319
Thank you all.
Post #1485843
Posted Monday, August 19, 2013 12:53 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 1:28 PM
Points: 11,157, Visits: 12,897
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

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
Post #1485954
Posted Monday, August 19, 2013 1:12 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Yesterday @ 10:32 AM
Points: 22, Visits: 319
Can you suggest me the best autogrowth settings on the tempdb files
Post #1485967
« Prev Topic | Next Topic »

Add to briefcase 1234»»»

Permissions Expand / Collapse