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)
 TEMPDB

Author  Topic 

dbalearner
Constraint Violating Yak Guru

272 Posts

Posted - 2010-01-06 : 19:59:45

Hi

I Have TEMPDB in the Instance which is growing as a result of the lengthy Job driven around several sp's and also the Datafiles MDF & LDF were also grown in its respective sizes, especially LDF in particular.

Please advise me is it correct to shrink OR truncate the TEMPDB files?

How to reduce OR trim the TEMPDB size .

Thanks all.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-06 : 23:08:07
You can shrink it via DBCC SHRINKFILE. An alternative is to restart the service to get it back to its original size.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-06 : 23:08:42
Are you tight on disk space though? If you aren't, then just leave it to be on the safe side. It'll reset its size when you restart at a later time.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

dbalearner
Constraint Violating Yak Guru

272 Posts

Posted - 2010-01-10 : 18:04:29
Thanks very much. Restart worked.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-11 : 13:31:49
You're welcome.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-01-11 : 13:52:12
quote:
Originally posted by dbalearner
How to reduce OR trim the TEMPDB size .



The real question is how to reengineer your batch process....if tempdb is getting huge...what about your transaction log?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

dbalearner
Constraint Violating Yak Guru

272 Posts

Posted - 2010-01-14 : 17:37:34
Good Question. However, My TempDB got increased to the extent where it can fall, but all my DB Level LDF's were not increased.

According to theory, when LDF gets to the HWM then automatically TEMPDB filled just because of some SP or batch process of DML, but in my case, it was not so.

Any clarification to this anyone please?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-01-15 : 03:05:45
"You can shrink it via DBCC SHRINKFILE"

There used to be dire warnings about the circumstances when this was doable "online" (i.e. for TEMPDB), is that still the case (SQL 2008, say), or is it now "safe"?
Go to Top of Page
   

- Advertisement -