September 16, 2008 at 4:49 am
I recently had to introduce a script
DBCC SHRINKDATABASE ( , 10)
that periodically shrinks a database.
However I also have a Maintenance Plan that runs once a week, part of which should shrink the database files (Remove unused space from database files is ticked, which should remove any unused space from the database, thereby reducing the size of the data files - according to BOL).
Is there a difference between these?
Regards
Steve
September 16, 2008 at 5:05 am
Normally you shldn't shrink database at regular intervals. This will unncessarily consume server resources like CPU, memory in case database grows later.
Shrindatabase statement will lae 10 percent free space in database and maintenance plan(ur case) will return any unused space to operating system leaving no space in data file(not good as file will grow later and resources will be consumed and application will be affected during filegrowth).
Chk: http://www.karaszi.com/SQLServer/info_dont_shrink.asp
MJ
September 16, 2008 at 6:07 am
The issue I had was that the maintenance plan was not reducing the data file size. So I assumed the free space was being removed, but the file size was not actually being shrunk? Hence i introduced the script to be run just once a month out of hours. Is this assumption correct?
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply