July 20, 2009 at 8:30 am
Hi
how to reduce tempdb size in production in ms sql 200/2005 with out any fail in production (i.e without restart ,without affecting the production without any loose )
😎
Thanks
Parthi
July 20, 2009 at 8:37 am
Look out for DBCC SHRINKDATABASE OR DBCC SHRINKFILE in BOL.
In most of the cases, restart is the only option.....
July 20, 2009 at 8:41 am
The server may slow down with SHRINKFILE, so be aware of that. You might be better off resizing the files, or if they were small and grew, just restarting the server. SQL starts quickly, and it is often back up by the time your phone rings
July 20, 2009 at 8:56 am
Hi!
Why do you need to reduce the size of tempdb?
I mean, what exactly is happening and why is the size of tempdb a problem?
I don't know of any good way to actually reduce the size of tempdb without restarting SQL Server (shrink will tend to not work well on tempdb), but my experience is that if tempdb grows out of of control, it's usually caused by a poorly written application or procedure which does not clean up after itself. Tempdb is intended as a temporary work database only, so anything stored there should be deleted immediately once it's no longer needed. When this does not happen, tempdb can grow very fast and the only real solution is to find the offending applications / procedures / users and change their behavior.
You can delete stuff from tempdb just like you can delete stuff from any other database, and while this will not actually reduce the size of tempdb, it will release space which can then be reused. However, don't try this at home unless you know what to delete - and finding out what to delete can often take some time, not to mention actually deleting it without harming any innocent bystanders in the process. Hence, to the best of my knowledge, the only "quick and easy" workaround is to restart SQL Server every time tempdb hits the ceiling or to keep throwing more disk at the problem until you have a permanent solution.
Vegard Hagen
Norwegian DBA, occasional blogger and generally a nice guy who believes the world is big enough for all of us.
@vegard_hagen on Twitter
Blog: Vegards corner (No actual SQL stuff here - havent found my niche yet. Maybe some day...)
July 20, 2009 at 9:21 am
Unless there were some "run away" query that blew TempDB to an insane size, don't shrink TempDB... it's just gonna grow again.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 20, 2009 at 1:59 pm
Before you shrink tempDB, read through this: http://support.microsoft.com/kb/307487
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
June 19, 2012 at 12:57 am
Hi
I think no need to restart server,restaring sql service
may solve the problem.
Ali
MCTS SQL Server2k8
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply