Before proceeding, I know the cons of doing this and have read many questions on same. But since we are here on urgent need and adding disk would take over a couple of days and the DB in question being not that critical, so is there a way I can release the unused space from database.
Below screenshot says unused space as 36 GB, but when I execute sp_spaceused it says unused as some 400 MB but unallocated much more.
I waited for almost 4 hours, trying to shrink in chunks, but not even a single MB got shrinked.
Is there a way this can be done or how can I manage the unallocated space?
Please advise.
Best Answer
Your
sp_spaceused
provides 2 sets of the data:- DB Size + Unallocated space - These numbers include BOTH: Data and log file; - Total statistics of RESERVED space for all objects within the database;
I bet your 36 GB of free space are in the Log file.
For real numbers use following query:
Might happen you still have some opened transactions, which hold you from shrinking individual files. See who hols them, close them. Reboot server if necessary. Shrink individual files while nobody accessing the database. switch it temporarily to Single User if necessary: