December 5, 2005 at 5:08 pm
DBCC ShrinkDatabase accepts a parameter for the amount of free-space, as a percentage, to be left in the database file(s) after the shrink takes place.
DBCC ShrinkFile, on the other hand, accepts a parameter to specify the size of the data file.
How do you determine how much space is currently being used (or how much space is free) in the target datafile?
December 5, 2005 at 10:14 pm
Hi..
U can use this to check the currently available space in the current DB
SP_SPACEUSED
Regards,
Papillon
December 6, 2005 at 12:39 am
Papillon,
Thanks for the reply. SP_SPACEUSED gets me the size of the database and the amount of unused space. What I need is the amount of unused space in each datafile. I have 3 filegroups with 3 datafiles each. If I used DBCC shrinkdatabase (dbname, 10), my understanding is that it leaves 10% free space in each datafile.
DBCC shrinkfile, which I'd prefer to use, doesn't have a "percent free" parameter, simply a target size (and a couple other parameters not related to size).
I'm hoping to find the used space in each datafile so that when I use DBCC shrinkfile, I can specify 10% over the used space.
Mitch
December 6, 2005 at 9:02 am
In SQL Enterprise Manager, switch to Task Pad view for the database.
December 6, 2005 at 10:27 am
GS,
That did it. Thanks very much.
Mitch
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply