August 28, 2002 at 5:49 am
Is there a batch file I can run that will shrink my .mdf and .ldf files each night. Some of them seem to grow quite large and I am having a hard time determining 1) Why they are growing so large and 2) What's the best possible method of keeping them shrunk.
Any help would be great. Thanks in advance.
August 28, 2002 at 7:21 am
You can run a job that will do DBCC Shrinkfile to free up the space. Both are typically set to grow by 10%, so some growth is the result of adding more data, you'll also see a lot of growth caused by index rebuilds - has to have space to move stuff around. Standard maintenance plan includes an option to shrink.
Andy
August 28, 2002 at 10:30 am
sometimes logs don't shrink well. There's a script in our library to help do that.
Steve Jones
August 28, 2002 at 3:11 pm
If you do via DBCC will work in SQL 2000 but you may have to run BACKUP LOG dbName WITH TRUNCATE_ONLY. If SQL 7 you will need the script Steve mentioned which is at http://www.sqlservercentral.com/scripts/scriptdetails.asp?scriptid=460&CategoryNm=Maintenance%20and%20Management%20&CategoryID=1
"Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply