Link to home
Start Free TrialLog in
Avatar of VBBRett
VBBRett

asked on

Shrink Job in SQL Server

I am running a shrink job on SQL Server 2005 and the database called TempDB became massively huge as in over 200 gigabytes.  I just started a shrink job on the database, so how long will this take before this finishes?
ASKER CERTIFIED SOLUTION
Avatar of Som Tripathi
Som Tripathi
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
A database will shrink only if the space alocated to it is not used. If TempDB grew so big is because it HAD to. Some activity required sorting, grouping  or huge temporary tables, ehich cause this.

An easy way to shrink tempdb is to restart the SQL server but this doesn't guarantee that it won't groe again later. You have to find out what causes it and at the same time make sure to give enough room to tempdb files to grow.

Here is a good article:

http://sqlserver2000.databases.aspfaq.com/why-is-tempdb-full-and-how-can-i-prevent-this-from-happening.html