事务日志备份失败错误:Backup detected log corruption in database
2023-09-11 14:21:09 时间
【1】错误信息
Backup detected log corruption in database FakeDBName. Context is FirstSector. LogFile: 2 ‘F:\SQLLOGS\XYZ\FakeDBName_Log.ldf’
VLF SeqNo: x502e VLFBase: x2ce40000 LogBlockOffset: x2d0a9000 SectorStatus: 2 LogBlock.StartLsn.SeqNo: x4ee3 LogBlock.StartLsn.Blk: x1348 Size: x200 PrevSize: x400 2009-03-06 10:00:02.61 Backup Error: 3041, Severity: 16, State: 1. 2009-03-06 10:00:02.61 Backup BACKUP failed to complete the command BACKUP LOG FakeDBName Check the backup application log for detailed messages. 2009-03-06 10:00:03.61 Backup Error: 3041, Severity: 16, State: 1.
【2】原因分析
1. 日志备份时,需要备份自上一次日志备份以来的整个日志链。日志链中的任何log corruption都会报错,并导致日志备份失败。
2. 为何完整备份没有报错呢?因为完整备份只需要少量的事务日志。
【3】解决思路
SQL Server 没有重建事务日志链的工具和直接方法。建议重建事务日志链:
1. 停止该数据库所有的事务;
2. 执行完整备份;
3. 将数据库的恢复模式改为“简单”,此步骤将删除原来的事务日志链。如有大量缓冲区的数据未回写硬盘,请执行 checkpoint。如有必要,可收缩事务日志文件。
4. 再将数据库的恢复模式改回“完整”;
5. 执行完整备份,此步骤将重建事务日志链;
6. 可继续执行事务日志备份。
相关文章
- SQL SERVER – Restore Database Backup using SQL Script (T-SQL)
- Database Files and Filegroups
- HOW TO BUILD AND RUN ORACLE DATABASE 19C ON DOCKER
- ORA-01507: database not mounted
- web sql Database
- Performing User-Managed Database-18.7、Performing Complete User-Managed Media Recovery
- odoo.sql_db: Connection to the database failed
- Database returned an invalid value in QuerySet.datetimes(). Are time zone definitions for your datab
- Keil5 software packs和legacy device database分类讲解
- The model backing the context has changed since the database was created.
- MySQL数据库断电修复(Database page corruption on disk or a failed)