广告
返回顶部
首页 > 资讯 > 数据库 >4215 The log was not truncated because records at the beginning of the log
  • 777
分享到

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

2024-04-02 19:04:59 777人浏览 安东尼
摘要

备份时报错The log was not truncated because records at the beginning of the log are pending replication. Ens

备份时报错

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/

您可能感兴趣的文档:

--结束END--

本文标题: 4215 The log was not truncated because records at the beginning of the log

本文链接: https://www.lsjlt.com/news/49881.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作