Groups | Blog | Home
all groups > sql server clients > february 2007 >

sql server clients : Shrink Tempdb


Rogers
2/5/2007 2:07:56 PM
Dear Professional,

One quick question, is there any way we can shrink tempdb database and don't
need to restart SQL Server services?

Thanks in advance

Andrew J. Kelly
2/5/2007 7:48:11 PM
Here are the supported ways to shrink tempdb.

http://www.support.microsoft.com/?id=307487

--
Andrew J. Kelly SQL MVP

[quoted text, click to view]

Rogers
2/7/2007 9:32:51 AM
Is there any I can shrink tempdb data file but don't want to restart the
services?

Thanks

[quoted text, click to view]

Hari Prasad
2/17/2007 6:17:23 PM
Hello,

You could use DBCC SHRINKFILE.

use tempdb
go
-- this command shrinks the data file
dbcc shrinkfile (tempdev, 'target size in MB')
go
-- this command shrinks the log file
dbcc shrinkfile (templog, 'target size in MB')
go

Thanks
Hari

[quoted text, click to view]

Rogers
2/19/2007 10:05:35 AM
Thanks hari, but this command is secure and not harmful to run in the
production box right.


[quoted text, click to view]

Mark Broadbent
2/20/2007 2:56:58 PM
if you do so during period of no activity there should not be any problems.
Schedule a job out of hours.

[quoted text, click to view]

AddThis Social Bookmark Button