简体   繁体   English

将SQL数据库从Azure VM过渡到Azure SQL数据库-新数据库的大小明显较小吗?

[英]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. 我在Azure VM上的SQL Server 2016 Enterprise上拥有大约70GB的数据库大小。 We decided to move this to an Azure SQL Database. 我们决定将其移至Azure SQL数据库。

I accomplished the move via the "Deploy to Azure SQL Database" (right-click on the database and it's under Tasks). 我通过“部署到Azure SQL数据库”完成了此操作(右键单击数据库,它位于“任务”下)。 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. 整个过程花费了大约3个小时,但所有步骤都被标记为成功。

The issue is the size of the resulting Azure SQL database is only showing as 31GB?? 问题是生成的Azure SQL数据库的大小仅显示为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? 是否有可能存在价值40GB的多余/临时/不需要的数据,而过渡过程认为这些数据是不必要的? 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. 可能是您有一个设置为70gb的数据库,但只有31gb的数据。 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. 使用SSMS连接到Azure VM中的SQL Server实例,右键单击数据库,单击Taks,现在选择“收缩”,然后选择“文件”。 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. 从“文件类型”中选择“日志”,它还应提供分配的大小和日志的可用空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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