December 16, 2010 at 9:23 am
Hi,
Recently I had a problem, the tempdb of my development server has grown more than usual, it used to be under 100MB, but now it's about 3.5GB. I'd like to know if I can shrink it without restarting my instance.
I run the sp_spaceused and this are the results:
database_name database_size unallocated space
--------------- ------------------ ------------------
tempdb 3569.99 MB 3515.84 MB
Since there is so much unallocated space I executed
USE [tempdb]
GO
DBCC SHRINKFILE (N'Templog2' , 0, TRUNCATEONLY)
GO
and
USE [tempdb]
GO
DBCC SHRINKDATABASE(N'tempdb' )
GO
But it still remains the same size. I'd like to know why is this happening? and if it is possible to shrink it without restaring my instance?
December 16, 2010 at 9:50 am
December 16, 2010 at 10:03 am
Hi I've already tried the methods that do not requiere to restart my instance, but non of them worked, I want to know why I can't shrink it without restarting my instance if I can se I have a lot of unallocated space.
December 16, 2010 at 10:34 am
@mvillegascellar
I had the similiar case as you and i use this code to shrink the tempdb.
USE tempdb
GO
DBCC SHRINKDATABASE(N'tempdb', 10, TRUNCATEONLY)
DBCC SHRINKDATABASE(N'tempdb', 10)
Regards,
Sushant
Regards
Sushant Kumar
MCTS,MCP
December 16, 2010 at 10:38 am
No Luck, sorry
The tempdb still remains the same size.
December 16, 2010 at 10:44 am
did you try to shrink it thru SSMS gui?
Regards,
Sushant
Regards
Sushant Kumar
MCTS,MCP
December 16, 2010 at 10:47 am
TRUNCATEONLY doesn't help much. As long as tempdb is in use, you can't shrink it no matter which method you follow. Try to kill the spids using Tempdb and then try to shrink it.
Thank You,
Best Regards,
SQLBuddy
December 16, 2010 at 12:33 pm
I disconect every session apearing in the sp_who2 which had a conection to tempdb and did the shrink but still no luck.I also tried to do it by the SQL Management Studio, but I get the same results.
I want to know why if I have so much space unallocated in my tempdb, I can't reclaim it?
December 16, 2010 at 12:41 pm
If you are unable to do anything, why dont you restart your sql server?
More options :-
Regards,
Sushant
Regards
Sushant Kumar
MCTS,MCP
December 16, 2010 at 12:43 pm
The procedure cache makes some objects remain in the tempdb. I had a similar issue[/url] and clearing the procedure cache helped me reduce the tempdb size.
Note: Please do not clear the procedure cache on Production systems unless you are very sure.
Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
December 16, 2010 at 1:10 pm
Try reading the following articles / blog posts to determine additional methods or items to check to determine why tempdb is not shrinking.
and
http://www.sqlservercentral.com/articles/tempdb/65919/
Viewing 12 posts - 1 through 11 (of 11 total)
You must be logged in to reply to this topic. Login to reply