问题描述
BACPAC和BAK文件在概念上是否相同?您可以用来在其中备份/还原数据库的一个自包含文件吗?
Are BACPAC and BAK files conceptually the same thing? A single, self contained file in which you can use to backup/restore a database?
推荐答案
BACPAC文件在事务上不一致,这可能导致数据库之间的数据在表之间不一致.这就是我的意思:如果开始创建BACPAC的过程,并且在此过程中源数据库中的某些数据得到更新,则BACPAC文件可能包含表A的数据(如1:00 PM)以及来自B的数据.表X的原始时间为1:03 PM ...但如果表A的更新时间也为1:03 PM,则如果表A的数据是在1:00 PM导出过程中导出的,则BACPAC文件中可能不存在更改.
BACPAC files are not transactionally consistent and that can lead to a database where data is not consistent across tables. Here's what I mean by this: if you start the process of creating a BACPAC and while that's going some data gets updated in the source database then the BACPAC file could contain data from table A as it was at 1:00 PM and also data from table X as it was at 1:03 PM ... but if table A was also updated at 1:03 PM that change may not exist in the BACPAC file if table A's data was exported at 1:00 PM by the export process.
从执行导出时没有写活动的数据源创建BACPAC导出很重要.
It's important to create BACPAC exports from data sources where there is no write activity while the export executes.
例如,在Azure SQL数据库中,最佳实践是首先创建相关数据库的副本,然后在该副本上(而不是在原始源db上)运行到BACPAC的导出.创建数据库副本在事务上是一致的,而导出到BACPAC则不一致.
In Azure SQL Database for example the best practice is to first create a copy of the database in question and then run the export to BACPAC on the copy (not on the original source db). Creating a copy of the database is transactionally consistent whereas the export to BACPAC is not.
这篇关于Azure BACPAC备份文件与SQL Server BAK文件有何不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!