简体   繁体   English

SQL Server和mysql上的增量备份

[英]incremental backups on SQL Server and mysql

One user has said to me 一位用户对我说

Applying incremental db backups is tedious, and a royal pain if you miss a step. 应用增量数据库备份是乏味的,如果您错过了一步,这将给您带来极大的痛苦。 I wouldn't bother with the approach on SQL Server or MySQL - that's what transaction logs are for, so you don't need to incorporate it into your data model 我不会理会SQL Server或MySQL上的方法-这就是事务日志的用途,因此您无需将其合并到数据模型中

So if i have transactions on mysql or sql server i can have a script to backup any data modified after or between date X and Y? 因此,如果我在mysql或sql服务器上进行事务处理,我可以有一个脚本来备份在日期X和Y之后或之间修改的任何数据吗? I ask because i am currently designing tables so i can do an increment dump instead of a full. 我问,因为我目前正在设计表格,所以我可以做一个增量转储而不是一个完整的转储。

Yes, you could backup the transaction logs rather than incorporate logic into your data model, providing the database supports it. 是的,您可以备份事务日志,而不是在数据库支持的情况下将逻辑合并到数据模型中。 Your previous question said that you were developing on SQLite... 您先前的问题是您正在使用SQLite进行开发...

Speaking from a SQL Server background, it can use transaction logs for both restoration and replication of a database. 从SQL Server的背景来讲,它可以将事务日志用于数据库的还原和复制。 An ideal setup would have three RAID drives setup - a mirror for the OS, RAID 5 (or better) for the data, and RAID 5 (or better) for the transaction logs. 理想的设置应具有三个RAID驱动器设置-用于操作系统的镜像,用于数据的RAID 5(或更高版本)和用于事务日志的RAID 5(或更高版本)。 The key part is the transaction logs being on their own RAID setup for optimal performance (not competing with read/write for data) and failover (because RAID is not a backup). 关键部分是事务日志位于自己的RAID设置上,以实现最佳性能(不与读/写竞争数据)和故障转移(因为RAID并非备份)。 For more info - see link . 有关更多信息, 请参见链接

MySQL transaction logs turns up info on the MySQL Binary Log , which also references replication so I figure there's a fair amount of carryover in approach. MySQL事务日志显示了MySQL Binary Log上的信息,该日志还引用了复制,因此我认为方法中有大量的遗留物。

On SQL Server: The key factor is the SLA time of recovery. 在SQL Server上:关键因素是SLA恢复时间。 A full a disaster recovery starts from the latest full backup, applies the latest differential backup, the applies all the log backups after the latest differential backup. 完整的灾难恢复从最新的完整备份开始,应用最新的差异备份,并在最新差异备份之后应用所有日志备份。 If you're missing differential backups from your recovery plan, then you must start from the full backup and then apply all log backups. 如果您的恢复计划中缺少差异备份,则必须从完整备份开始,然后应用所有日志备份。

The differential backup thus reduces the recovery time by eliminating the need to apply all log backups taken between the last full backup and the last differential backup. 因此,差异备份通过消除了应用在上次完整备份和上次差异备份之间进行的所有日志备份的需要,从而缩短了恢复时间。

If your database is small, differential backups don't add much advantage because the recovery time is small to start with. 如果您的数据库较小,则差异备份不会增加太多优势,因为恢复时间从一开始就很小。 But on large databases it makes a difference, as the log backups can be quite large and going through days of log adds up to the recovery time. 但是在大型数据库上,它会有所不同,因为日志备份可能非常大,而且日志的工作日数加起来会增加恢复时间。 Adding differential backups can cup back the recovery time by few hours. 添加差异备份可能会使恢复时间缩短数小时。

I'm not sure I follow your argument about designing tables with differential backup in mind, the two subjects are orthogonal. 我不确定我是否遵循您关于在设计表时要考虑差异备份的观点,因为这两个主题是正交的。

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

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