溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

4215 The log was not truncated because records at the beginning of the log

發布時間:2020-08-17 16:17:35 來源:ITPUB博客 閱讀:293 作者:o0yuki0o 欄目:關系型數據庫

備份時報錯

The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.
查找了下問題
用了以下腳本解決
--run 
sp_replicationdboption 'datayesdb','publish','true'
--then run sp_repldone with the following parameter
EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0,    @time = 0, @reset = 1
--then unpublish the database
sp_replicationdboption 'datayesdb','publish','false'
--Run
dbcc traceon(3604)
dbcc opentran --- against the database to ensure there are no replicated transactions.
--the following scripts will show the detail sql script for the session
use master
declare @spid int;
declare @sql_handle binary(20);
set @spid = 601
SELECT @sql_handle = sql_handle
FROM sysprocesses As A with (nolock)
where spid = @spid
select text
from ::fn_get_sql(@sql_handle)
 USE [datayesdb]
GO
DBCC SHRINKFILE (N'datayesdb_log' , 0)
GO

參考
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/c96f3cb4-5f4e-49a4-a84a-6e2cd46915a3/the-log-was-not-truncated-because-records-at-the-beginning-of-the-log-are-pending-replication?forum=sqlreplication
please notice the following related issue 
Another connection is already running 'sp_replcmds' for Change Data Capture in the current database.
will be occure if you not run the sp_replflush after you cleanup the log file and you need to enable the cdc captupre
for detail info you can refer the following website
http://www.midnightdba.com/DBARant/another-connection-is-already-running-sp_replcmds-for-change-data-capture-in-the-current-database/

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女