完整恢复模型是否会生成额外的事务日志?
我读了一些关于恢复/备份的在线书籍,一个愚蠢的问题,如果我使用完整数据库备份/完整恢复模型,对于备份操作本身,它会生成任何额外的事务日志到源数据库服务器吗? 完整恢复操作是否会生成额外的事务日志到目标数据库?
I read some Books Online about recovery/backup, one stupid question, if I use full database backup/full recovery model, for backup operation itself, will it generate any additional transaction log to source database server? Will full recovery operation generate additional transaction log to destination database?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对此的一个更有用的观点可能是说,完全恢复可以防止事务日志的内容被覆盖而没有其他允许它们被覆盖的操作
SQL Server 将记录大多数事务(例如批量加载和除了其他一些),并且当在简单恢复模式下运行时,在与创建相同的事务结束时有效地丢弃新创建的日志内容。 在完全恢复模式下运行时,传输日志的内容将保留,直到标记为可覆盖。 为了将它们标记为可被覆盖,通常会执行备份(完整备份或跨日志备份)。
如果事务日志中没有空间并且没有标记为可覆盖的日志内容,则 SQL Server 将尝试增加日志的大小。
实际上,完全恢复要求您管理事务日志,通常是每隔一段时间执行一次事务日志备份(如果您没有 SLA 需要执行或没有其他驱动程序来确定备份的频率,则每 1 小时可能是一个很好的经验法则)做这个)
A more useful view of this might be to say that Full Recovery prevents the contents of the transaction log from being overwritten without some other action allowing them to be overwritten
SQL Server will log most transactions (e.g. bulk load and a few others aside) and when running in simple recovery mode, effectively discard the newly created log contents at the end of the transaction associated with the creation of the same. When running in Full Recovery mode the contents of the trans log are retained until marked as available to be overwritten. To mark them as available to be overwritten one normally performs a backup (either Full or Trans Log).
If there is no space in the trans log and no logs contents marked as available to be overwritten then SQL Server will attempt to increase the size of the logs.
In practical terms Full Recovery requires you to manage your transaction logs, generally by performing a trans log backup every so often (every 1 hour is probably a good rule of thumb if you have no SLA to work to or other driver to determine how often to do this)
我不确定我完全理解你的问题,但就这样吧。 将数据库保持在完全恢复模式可能会使事务日志变得非常大。 代价是您可以恢复到恢复点。
事务日志比正常情况大的原因是所有事务都已完整记录。 这可以包括批量记录操作、索引创建等。
如果驱动器空间不是问题(并且驱动器如此便宜,则不应如此),这是推荐的备份方法。
I'm not sure I completely understand your question, but here goes. Keeping your DB in Full Recovery mode can make your transaction logs grow to be very large. The trade off is that you can restore to the point of recovery.
The reason that the transaction logs are larger than normal is ALL transactions are fully logged. This can include bulk-logged operations, index creation, etc.
If drive space is not a concern (and with drives being so inexpensive, it shouldn't be), this is the recommended backup approach.