Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Clearing SQL 2005/20008 TempDB


Clearing SQL 2005/20008 TempDB

Author
Message
tpalmer
tpalmer
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 243
We have an alert that allows us to monitor the system TempDB on SQL 2005 and 2008 instances. The monitor basically monitors the TempDB and reports back the LogSpaceUsed% if for 30 straight minutes the threshold is over 60% [fyi, I runs DBCC SQLPERF ('logspace')behind the scenes]. The LogSpaceUsed% value does go down, but never to an acceptable level (for instance the log file size is 16 GB and 8 GB or 50% never seems to clear).

How do I go about finding what exactly is in the Temp DB using these resources so I can start to troubleshoot the calls? What is the best way of tackling finding out the contents.

Any thought or help would be appreciated.
brekher
brekher
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 178
Why not just shrink it with DBCC SHRINKFILE commands and/or create mulitple files?
tpalmer
tpalmer
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 243
I do not think you understand. Why shrink the Temp DB? Llet me start again.

System TempDB has 1 LDF device of 16 GB. We get alerts when the TempDB Usage is over 60%, meaning there are transaction using the TempDB. Once a transaction is finished, it should clear out of the log. I am looking for help finding the best way to see what is actually using resources in the TempDB log at any given time. I am not looking shring Temp DB (and this is definitely not recommended practice from Microsoft). I want the 16 GB log file, I just want to see if I can find out what is using the space.

"Hmmm. Lets go see what is utilizing the TempDb right now."

Thx!
brekher
brekher
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 178
give this a shot, hope it helps!

http://www.sqlservercentral.com/blogs/steve_jones/archive/2009/11/30/what-s-using-space-in-tempdb.aspx
tpalmer
tpalmer
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 243
That is exactly what I needed. If I find any issues, I will post it. Thanks!
Ian C0ckcroft
Ian C0ckcroft
SSC Eights!
SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)SSC Eights! (874 reputation)

Group: General Forum Members
Points: 874 Visits: 863
thanks guys. also helped me

Ian Cockcroft
MCITP BI Specialist
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: 44983 Visits: 39870
brekher (10/14/2011)
Why not just shrink it with DBCC SHRINKFILE commands and/or create mulitple files?


How about because if you try to do a shrink on temp db while the server is in other than a single user mode, you could end up corrupting databases.

Also, shrinking Temp DB is normally a futile exercise unless you've found out and fixed whatever made it grow beyond expectations.

--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 usually 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
Perry Whittle
Perry Whittle
SSCrazy Eights
SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)SSCrazy Eights (8.8K reputation)

Group: General Forum Members
Points: 8780 Visits: 16554
Jeff Moden (10/22/2012)
a futile exercise

we are Borg :-D ;-)

-----------------------------------------------------------------------------------------------------------

"Ya can't make an omelette without breaking just a few eggs" ;-)
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