简体   繁体   中英

Transitioned SQL database from Azure VM to Azure SQL database - size of new db is significantly smaller?

I have a database of approximately 70GB in size residing on SQL Server 2016 Enterprise on an Azure VM. We decided to move this to an Azure SQL Database.

I accomplished the move via the "Deploy to Azure SQL Database" (right-click on the database and it's under Tasks). This wizard seemed very complete and ran a battery of tests, followed by doing the deployment step-by-very-detailed-step. The full process took about 3 hours, but it finished with all steps marked as success.

The issue is the size of the resulting Azure SQL database is only showing as 31GB?? Is this possible? Is there a possibility that there were 40gb worth of extraneous/temporary/unneeded data that the transition process recognized as unnecessary? As you can imagine, I'm very hesitant to take down the original database and start using the new one given this difference in size.

It could be that you had fragmented indexes and moving them from one place to another allowed for a rebuild eliminating wasted space. It could be that you just had a database that was set to 70gb but only had 31gb of data. The size of your backups should give you an indication of the actual size of the data in your system. Run counts on the tables to ensure that both data sets match.

The size of the data files seen from the operating system is not a good indication of the size of the data they content. Connect with SSMS to the SQL Server instance in your Azure VM, make a right click on the database, make a click on Taks, now select Shrink, then select Files. Look at the "Currently allocated space" and the "Available free space" of the Data file. From the "File type" choose "Log" and that should give the allocated size and the free space of the log also.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM