Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBCC SHRINKFILE shrinks below specified file size


DBCC SHRINKFILE shrinks below specified file size

Author
Message
Jeffrey Williams 3188
Jeffrey Williams 3188
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4468 Visits: 9836
hemul (2/21/2011)
Hi, thanks for your input. If this is the expected behavior of the shrink command, then the documentation is wrong or misleading:
http://msdn.microsoft.com/en-us/library/ms190488(v=SQL.90).aspx
The database cannot be made smaller than the minimum size of the database. The minimum size is the size specified when the database is originally created, or the last size explicitly set by using a file size changing operation such as DBCC SHIRNKFILE or ALTER DATABASE.

So the question is whether there's something wrong the documentation or the command itself?


Well then, the documention is wrong - not the command.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

hemul
hemul
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 118
Okay thank you. There seems to be an essential, yet so vague distinction between the initial size and default size of a database.
Conclusions by this thread:

- ALTER DATABASE ... MODIFY FILE with SIZE parameter alters only the default size, not the initial size.

- The initial size is set when you create your database, using the SIZE parameters.

- The only way to change initial size is to use DBCC SHRINKFILE with the target_size parameter. Note: the initial size cannot be increased, ie. specifying a larger size as the target_size has no effect.

- A workaround to increase initial size is to create a new database with larger size, and migrate everything (structure and data)

- The behavior of DBCC SHRINKFILE / SHRINKDATABASE contradicts the documentation: They ignore the default size, but will not shrink below the initial size (unless you set the target_size parameter)

- SQL Server Management Studio GUI adds even more to the confusion: if you check the properties of a database, the Files page has a misleading Initial size column, which actually gives you the default size value. Changing this value translates to the following T-SQL: ALTER DATABASE [x] MODIFY FILE ( NAME = N'x_Data', SIZE = xKB )
seven.srikanth
seven.srikanth
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 463
Good One....;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search