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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TEMPDB.MDF size

Status
Not open for further replies.

crot

Vendor
Oct 6, 2005
4
0
0
ZA
Hi,
could anyone help me with TEMPDB.
Is it possible to reduce the size of tempdb.MDF file?
I've tried "Shrink" database without success.

Thankyou for help.
 
shrinkdatabase will not shrink a db less than it's minimum size, where minimum size is defined as (this is from books online)

The minimum size of a file is the size specified when the file was originally created, or the last explicit size set with a file size changing operation such as ALTER DATABASE with the MODIFY FILE option or DBCC SHRINKFILE.

I'm not sure exactly how the system extends TEMPDB but if it does an explicit ALTER DATABASE then it may be changing the db minimum size.

I've found the best way to force TEMPDB smaller is to use DBCC SHRINKFILE, eg in query analyser with tempdb as the current database

dbcc shrinkfile (tempdev, 3)

tempdev is the logical name of the tempdb data file (select * from sysfiles will show you this), the second parameter is the target size in Mb.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top