Link to home
Start Free TrialLog in
Avatar of yrcdba7
yrcdba7Flag for United States of America

asked on

error 21335 the new DBFile size must be larger than the current size

Expert,

I want to reduce the log file size from current space allocated 7000 mb to 3500 MB my DB size is 17GB. I tried to give space allocated is 3500 but it poped out error like
Error 21335 The new DBFile size must be larger than the current size.

Can you help?

Thanks!
Avatar of Faiga Diegel
Faiga Diegel
Flag of United States of America image

You have to make sure that the log file is not less than 3.5 GB. You wont be able to reduce it to 3500 MB if the log file size is more than 3.5 GB
Avatar of yrcdba7

ASKER



My log file used 100 MB, space allocated 7GB, I want to reduce space allocated to 3.5 GB.
It is likely the case that it was initially setup at a certain level (7GB) and you are unable to shrink it past it's initially set value. You can try with the DBCC SHRINKFILE command specifyin the size in MBs for the new logfile.

Depending on how you setup the log file you won't be able to shrink it as small as you like, basically the smallest you can get to is the size of the Virtual Log Files.

Try it with the shrink command. Please note that shrinking data and log files is not a normally recommended practice. It is best to pre-allocate to the right size you expect to need and leave it at that point. There are times, however, where perhaps your initial estimates are wrong or you are in a dev environment where shrinking is necessary.


ASKER CERTIFIED SOLUTION
Avatar of MikeWalsh
MikeWalsh
Flag of United States of America 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