Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Database cannot reduce the sizing

Azure Database cannot reduce the sizing from 750 to 500 GB.

Overall sizing after I checked in the Azure dashboard.

  • Used space is 248.29 GB.
  • Allocated space is 500.02 GB
  • Maximum storage size is 750 GB.

The validation message when I reduce the sizing:

Message is

The storage size of your database cannot be smaller than the currently allocated size. To reduce the database size, the database first needs to reclaim unused space by running DBCC SHRINKDATABASE (XXX_Database Name). This operation can impact performance while it is running and may take several hours to complete.

What should I do?

Best Regard

like image 804
HoHo-Akkara Siriailikul Avatar asked Jun 12 '26 19:06

HoHo-Akkara Siriailikul


1 Answers

If we want to reduce the database size, we need to ensure the number of databse size is larger than the number of the Allocated space you set. Now, according to your need, we should reclaim unused allocated space. Regarding how to do it, we can run the following command

-- Shrink database data space allocated.
DBCC SHRINKDATABASE (N'db1')

For more details, please refer to the document

like image 65
Jim Xu Avatar answered Jun 18 '26 00:06

Jim Xu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!