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

to shrink the tempDB

Status
Not open for further replies.

maswien

Technical User
Sep 24, 2003
1,286
CA

My question is, if for some reason we can't always restart SQL Server and the size of tempdb is too big, what is the best way to shrink it?

Thanks!
 
DBCC SHRINKFILE

“I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" --
 
Or DBCC ShrinkDatabase.

In addition to shrinking the file you will want to find out why it is getting larger. If it is growing regularly (do to maintaince plans or large daily/weekly bulk updates, etc that shrinking it won't do anything besides place un-needed additional load on the disks.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top