温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-08-17 16:17:35 来源:ITPUB博客 阅读:256 作者: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