Wednesday, March 21, 2012

Problem with shrinking a DB??

All,
Question I am trying to shrink my 150GB .mdf to 90GB is it possible to do
this without taking the server offline? I tried to use the command below
without success, any idea?
USE database_name
GO
DBCC SHRINKFILE (Data_filename, 90000)
GO
Thanks,
JayHi
Using DBCC SHRINKFILE does not need to be carried out whilst in single user
mode, although it could affect the performance if it is being used. DBCC
SHRINKFILE will not shrink a file smaller than the space required to hold the
data. If you shrink a file too small then it will only grow again which will
affect performance (during this), the file may also end up being more
fragmented, therefore if you have the space it may be better to leave the
file at this size. Make sure that you are not using a percentage as the
growth amount.
Also check out the disc fragmentation of the underlying discs as this will
effect performance.
John
"Jay" wrote:
> All,
> Question I am trying to shrink my 150GB .mdf to 90GB is it possible to do
> this without taking the server offline? I tried to use the command below
> without success, any idea?
> USE database_name
> GO
> DBCC SHRINKFILE (Data_filename, 90000)
> GO
> Thanks,
> Jay

No comments:

Post a Comment