A database shrink task has 0 MB recovered

After a database shrink task is completed, if you see an event log indicating that no database space has been recovered, the reasons may be as follows:
  • Fragmentation
    : Shrink operations can cause fragmentation. Data fragmentation occurs when data pages and indexes are not stored in contiguous locations. This can make it difficult for the shrinking operation to recover space efficiently.
  • File size limitation
    : The database file cannot be shrunk below its minimum size, which is set when the database was created or explicitly defined later. For example, if a database was originally created with a size of 10 MB and grew to 100 MB, the smallest size the database could be reduced to is 10 MB, even if all the data in the database has been deleted.
  • Active transactions
    : If there are active transactions or uncommitted changes, the space cannot be reclaimed until these are resolved. These active transactions can lock data pages, preventing the shrinking operation from releasing the space they occupy.
  • Untruncated log files
    : For log files, if the log has not been truncated, the space may not be freed. Setting the recovery model to SIMPLE or performing a log backup can help.
  • Reserved space for future use
    : Microsoft SQL Server may reserve free space to be available for future operations, which can make it seem like the shrinking operation did not free up as much space as expected.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal