gpt4 book ai didi

sql-server - 将数据库迁移到 Azure 的 Bacpac 与 dacpac

转载 作者:行者123 更新时间:2023-12-03 01:51:09 25 4
gpt4 key购买 nike

我正在将大型数据库(架构和数据)从本地服务器部署到 Azure SQL。我计划使用sqlpackage.exe从命令行。看起来有两个选择:

  1. 提取 DACPAC,然后使用以下命令将其发布到 Azure:ExtractAllTableData 选项可在提取中包含数据
  2. 导出 BACPAC,然后将其导入到 Azure

有更好的选择吗?我需要这个过程以尽可能最快的方式运行,所以我很好奇是否有一个选项对性能更好。

最佳答案

正如 Grant 所说,bacpac 是 dacpac+data。下面是另一个可能有帮助的定义

“bacpac 包含数据库中的架构和数据。dacpac 仅包含架构而不包含数据”

您可能已经明白,您需要 bacpac。

I need this process to run in the fastest way possible, so I'd be curious if one option is better for performance.

我们在Azure中只有很少的数据库(400Gb)。我们观察到,当我们从存储加载数据时,导入数据的速度更快。我们遵循的方法是将数据加载到与数据库位于同一位置的存储中,然后导入数据..

SQLSERVER 团队测试了一些选项,他们发现与其余选项相比,BCP 速度最快..

enter image description here

以下是将 bcp 数据导入 azure 的方法

bcp TestDB.dbo.Customer in "C:\Users\cesardl\BCP\Customer.txt"
-c -U mysqlazureuser@mysqlazureservername
-S tcp:mysqlazureservername.database.windows.net
-P mypassword

进一步阅读/引用:

Importing/Exporting data to SQL Azure databases using BCP and SQL Scripts
Loading data to SQL Azure the fast way

关于sql-server - 将数据库迁移到 Azure 的 Bacpac 与 dacpac,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48069034/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com