How do I shrink Tempdb in SQL2005 in real time

jlhmead
jlhmead used Ask the Experts™
on
How can I safely shrink tempdb during the day. I can't take an outage during the day. Coul dI backup then truncate freespace? What about reorganizing the db? Any advice would be helpful.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
AneeshDatabase Consultant
Top Expert 2009

Commented:
Hello jlhmead,

http://support.microsoft.com/kb/307487

Regards,

Aneesh

Author

Commented:
I have read that. I can't take an outage, so how can i shrink the db with out shutting down sql?
Database Consultant
Top Expert 2009
Commented:
did u read the second method

dbcc shrinkdatabase (tempdb, 'target percent')

or
use tempdb
   go

   dbcc shrinkfile (tempdev, 'target size in MB')
   go
   -- this command shrinks the primary data file

   dbcc shrinkfile (templog, 'target size in MB')
   go
   -- this command shrinks the log file, look at the last paragraph

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial