Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tempdb won't shrink

Status
Not open for further replies.

ianicr

IS-IT--Management
Joined
Nov 4, 2003
Messages
230
Location
GB
I noticed my tempdb is 2 gigs earlier. This seems a little large to me. I did a bit of googling and came up with this:

use tempdb
backup log tempdb with NO_LOG
dbcc shrinkfile (templog,0)
dbcc shrinkfile (tempdev,0)

however this doesn't shrink the data file only the log. Any ideas why? or how I can shrink it?

Thanks
 
Try stopping and restarting SQL Server

Thanks

J. Kusch
 
You also CAN NOT shrink any database smaller than the size of the MODEL database. You are trying to shrink the TEMPDB to 0 and that can't be done. Check the size of the MODEL db and then try running the DBCC SHRINKFILE with that number.

BTW the syntax is DBCC SHRINKFILE (file_name, target_size)
and target_size must be an INTEGER in megabytes.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top