Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 How to reduce the size of tempdb?

Author  Topic 

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2008-04-29 : 12:04:36
Hi All,

On my server C drive is of 34GB. Right now tempdb size is 22GB which is causing C drive to be full. How I can I reduce it? I dont want to move tempdb to any other drive, and I am only looking a way to reduce its size.

Please help quickly....
Thanks,

Zee

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-29 : 14:25:45
use DBCC ShrinkDB.
but that won't really help you in the long run since it will grow again.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-29 : 14:37:31
That is big size. Don't put Tempdb in C: drives as it does all operations like sorting, DBCC CheckDB . Well ,restarting the server will solve the problem if you can bear downtime.
Go to Top of Page

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2008-04-29 : 14:50:13
Its in production I dont want to retart the sever.
I need to know how to use DBCC ShrinkDB? Any tips please? Do I need to provide any parameters while running it? If yes what they should be in my situation.

Thanks for the help,

Zee
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-29 : 15:10:48
DBCC SHRINKDATABASE:
http://msdn2.microsoft.com/en-us/library/ms190488.aspx

DBCC SHRINKFILE:
http://msdn2.microsoft.com/en-us/library/ms189493.aspx

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-29 : 15:11:50
and this will make your life even easier:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80355

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

zeeshan13
Constraint Violating Yak Guru

347 Posts

Posted - 2008-04-29 : 15:42:55
DBCC SHRINDATABASE failed b/c of insuffient space.
I restarted MSSQLSERVER service which took few seconds to complete. Now out of 34GB drive on C I have 23GB free :)
Now I should investigate why its getting so big, but I am tied up with other things and I will leave it for later.

Thanks everyone for thie help.

Zee



Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-04-29 : 16:38:38
You really should determine if you can move it do a different drive/array it possible. One with more space and preferably dedicated solely to tempdb (not always possible, I know!).

Terry
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-04-29 : 22:23:03
Agree, it'll go back to 34gb or even bigger if sql needs it.
Go to Top of Page
   

- Advertisement -