简体   繁体   English

SQL Azure备份:事务一致意味着什么?

[英]SQL Azure Backup: What does transactionally consistent mean?

I'm using redgate's sql azure backup tool: http://www.red-gate.com/products/dba/sql-azure-backup/ 我正在使用redgate的sql azure备份工具: http//www.red-gate.com/products/dba/sql-azure-backup/

It looks like if you check "Make Backup Transactionally Consistent" you get charged a full day's use for sql server. 看起来如果您选中“使备份事务一致”,您需要为sql server充电一整天。 I'm wondering if I need to check this. 我想知道我是否需要检查一下。

I do daily backups to blob storage and I backup the database to my local machine to work with every 3 days or so. 我每天备份到blob存储,我将数据库备份到我的本地计算机,每3天左右工作一次。

If I don't check the Transactionally Consistent box, am I going to run into any problems? 如果我不检查Transactionally Consistent框,我会遇到任何问题吗?

Well as the person who wrote SQL Azure Backup at Red Gate I can say that the only way to create a guaranteed transactionally consistent backup in Azure currently is indeed to use CREATE DATABASE ... AS COPY OF. 在Red Gate上编写SQL Azure备份的人我可以说,在Azure中创建有保证的事务一致性备份的唯一方法当前确实是使用CREATE DATABASE ... AS COPY OF。 This copy only exists for the duration of us taking the backup and is then dropped immediately afterwards. 此副本仅在我们进行备份的持续时间内存在,然后立即删除。

If you don't check the box you'll only hit problems if there is a risk of transactions being in an inconsistent state when reading the data from each table in turn. 如果不选中该框,则只有在从每个表中依次读取数据时,如果存在事务处于不一致状态的风险,您才会遇到问题。 CREATE COPY OF can take a very long time and also may cost money for the copy too. 创建复制可能需要很长时间,也可能需要花钱。

If you're backing up to a BLOB you're using the Microsoft Import Export service rather than SQL Compare and SQL Data Compare technology but that also reads data from the tables to could be inconsistent too. 如果您要备份到BLOB,那么您使用的是Microsoft Import Export服务,而不是SQL Compare和SQL Data Compare技术,但是也会从表中读取数据,这也可能不一致。

Hope this helps Richard 希望这有助于理查德

AFAIK transactionally consistent means that you get a snapshot of the database at a point in time (which presumably means SQL Azure locks the db while (quickly we hope) it makes a copy of the entire database = your one day charge for a db that exists for only a few minutes). AFAIK事务一致意味着您可以在某个时间点获取数据库的快照(这可能意味着SQL Azure会锁定数据库(我们希望很快)它会生成整个数据库的副本=您存在的数据库的一天费用只有几分钟)。

This is better illustrated by non-transactionally consistent backup where begin by copying table X. While you are doing that someone amends (as it's a live database) table Y, which later gets copied to the backup. 通过非事务一致性备份可以更好地说明这一点,从复制表X开始。在执行此操作时,有人会修改(因为它是一个实时数据库)表Y,后者会被复制到备份中。 The foreign keys between X and Y might now not match 'cos X is from an earlier time period than Y. X和Y之间的外键现在可能不匹配'cos X来自比Y更早的时间段。

I have used Sql Azure Backup and I did go for transactional consistency because the backups are for an emergency and the last thing I want in that scenario is inconsistencies in the data. 我使用过Sql Azure备份,但我确实考虑了事务的一致性,因为备份是针对紧急情况的,在这种情况下我想要的最后一件事就是数据不一致。

edit: now I think about it, Redgate should really state that if you backup every day you are effectively paying twice the rate for your database. 编辑:现在我想一想,Redgate应该说明,如果你每天备份,你实际上是为你的数据库支付两倍的费率。 I've been waiting for the sync framework which I think is there now... 我一直在等待我认为现在存在的同步框架......

To answer the question in the title: a SQL Azure database copy (the 'backup') is a SQL Azure database that is copied (fully online) from the source database and contains no uncommitted transactions (ie. is transactionally consistent ). 要回答标题中的问题:SQL Azure数据库副本(“备份”)是从源数据库复制(完全在线)的SQL Azure数据库,不包含任何未提交的事务(即事务上一致 )。 This is achieved the same way database snapshots or backup restores achieve consistency on the standalone SQL Server product: all pending transactions at the moment of 'separation' are rolled back. 这与数据库快照或备份还原在独立SQL Server产品上实现一致性的方式相同:回滚“分离”时的所有待处理事务。

As to why or how RedGate's product utilizes this, I don't know. 至于RedGate的产品为何或如何利用这一点,我不知道。 I would venture a guess that in order to achieve a 'transitionally consistent backup' they are doing a CREATE DATABASE ... AS COPY OF ... (which creates the desired transactionally consistence) and then they use the technology from SQL Compare and Data Compare to copy out the schema and data. 我想冒昧地猜测,为了实现'过渡一致的备份',他们正在做一个CREATE DATABASE ... AS COPY OF ... (创建所需的事务一致性),然后他们使用SQL CompareData中的技术比较复制模式和数据。

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

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