Moving SQL Server to Azure in a VM.
The current SQL Server has a total database size of 1.8TB, and 1.2TB of unallocated space.
How do I change the total database size, so it is more in line with what's been used?
So, when I restore the back-up inside the Azure VM, I don't end up over paying for storage space that I am not using.
Any lead is appreciated.
CodePudding user response:
To eliminate that extra space on data and log files, the process used is the Shrink File. It can be found on SQL Server Management Studio, right clicking the database on Object Explorer, and navigating to Tasks > Shrink > Files, and then selecting the option "Reorganize pages before releasing unused space". But for really large databases, like your case, this can take days to complete. I've seen some databases get recreated, then all the data migrated, then all the indexes recreated, just to skip a Shrink Files process that was taking forever to finish.