[SQL SERVER] One or more recovery units belonging to database failed to generate a checkpoint (Error 5901)(Error 9003)

The log scan number (288175:365436:0) passed to log scan in database  is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.

Error: 9003, Severity: 20, State: 9.

 

One or more recovery units belonging to database failed to generate a checkpoint. This is typically caused by lack of system resources such as disk or memory, or in some cases due to database corruption. Examine previous entries in the error log for more detailed information on this failure.

Error: 5901, Severity: 16, State: 1.

 

資料庫出現上面兩訊息,備份會失敗,也無法checkpoint,所以log file成長變很大

檢視

SELECT log_reuse_wait_desc FROM sys.databases where name = N'database'

發現詭異的事情,竟然為REPLICATION,但是我這台instance並沒有複寫呀。

 

處理方式如下

1. 直接執行 sp_removedbreplication N'database' 清除replication,不過並沒有成功

2. 建立發行集,複寫>本機發行集>新增發行集 (以該資料庫為發行集),建立完成後,竟然可以checkpoint,可以清掉log file了

3. 刪除發行集,一切恢復正常

 

為何會出現這個問題呢?

這問題出現前

該資料庫某一個資料表出現一致性錯誤,所以我有執行dbcc checktable()修復,且把原本該資料庫的page_verify從TORN_PAGE_DETECTION改成checksum

然後這問題就出現了...