问题:
Could not redo log record (410417:192254:28), for transaction ID (0:1838907632), on page (1:761914), allocation unit 72057594280869888, database '****' (database ID 5). Page: LSN = (410417:191949:3), allocation unit = 72057594280869888, type = 10. Log: OpCode = 7, context 10, PrevPageLSN: (410417:192254:26). Restore from a backup of the database, or repair the database.
Version:
Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64)
Mar 18 2018 09:11:49
Copyright (c) Microsoft Corporation Enterprise Edition (64-bit)
on Windows Server 2016 Datacenter 10.0 <X64> (Build 14393) (Hypervisor)
从日志上看这个错误经常出在Truncate 表后的 Insert 操作时的首页分配(Allocate First Page)。
SELECT *
FROM fn_dump_dblog ('410417:191949:3', '410417:192254:28', N'DISK', 1, N'E:\BackUp\dbname_2019_05_04_020310_6766368.trn',
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT)
WHERE [transaction ID] ='0000:6d9b80f0'
回答1:
每次出现 3456 错误后,从日志上去查看对应的事务信息时,每次对应的对象都是两个物理表(Temp_Table1/Temp_Table2:这两个都用于将内存数据更新到DB时用到的中转表,会频繁的 Truncate—> Insert)。对应的操作都是在Truncate 表后的 Insert 操作时的首页分配(Allocate First Page)。
猜测是频繁 Truncate—> Insert 物理表造成的。将两个中转表改为临时表后问题解决了。
回答2:
参考 SOLVED: SQL SERVER ERROR 3456 SEVERITY 21 STATE 1