积极答复者
完整备份能截断日志吗?

问题
全部回复
-
不!
唯一能让那个日志截断的是日志备份。
原因:完全备份只是读取必要的日志记录,用来在恢复的时候,保证数据库事务的一致性,其他的日志并没有被备份。
Please click the Mark as Answer button if a post solves your problem!
- 已编辑 Michael CS 2012年11月12日 3:17
-
不!
唯一能让那个日志截断的是日志备份。
原因:完全备份只是读取必要的日志记录,用来在恢复的时候,保证数据库事务的一致性,其他的日志并没有被备份。
Please click the Mark as Answer button if a post solves your problem!
虽然你的结论没错。但是原因不对。完全备份,或者说叫数据库备份,包含当时的完整日志。
想不想时已是想,不如不想都不想。
完全备份,或者数据库备份,并不包含当时的完整日志。
完全备份,或者数据库备份中包含的日志的开始点为下面个3个LSN中的最小者:
最后一个checkpoint的LSN,
最老活动事务日志的的起始LSN
最后一个复制事务的LSN
Please click the Mark as Answer button if a post solves your problem!
- 已编辑 Michael CS 2012年11月12日 7:15
-
For this question, I would suggest to read Paul's article:http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-the-log-and-log-backups-how-to-convince-yourself.aspx
he FULL recovery model means that every part of every operation is logged, which is called being fully logged. Once a full database backup has been taken in the FULL recovery model, the transaction log will not automatically truncate until a log backup is taken. If you do not want to make use of log backups and the ability to recover a database to a specific point in time, do not use the FULL recovery model. However, if you wish to use database mirroring, then you have no choice, as it only supports the FULL recovery model.
-
我做的一个实验。如下:(数据库备份后,日志明显少了,是不是说明备份后日志截断了呢)
1、在备份数据库前的日志文件
dbcc log(ReportServer$MSSQL2008,4) --实际上有480条日志记录
2、执行完back后的日志文件 --只有10条日志记录
backup database ReportServer$MSSQL2008 to disk = 'D:\temp\cutlog.bak'
???图怎么穿不上来呀???
What's recovery mode of the db? If it's in simple recovery mode, sql will truncate log on checkpoint. It's nothing to do with full backup.