Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Backup Times error

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.

Looked up the problem.

Use the following script to solve the problem

-- 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 (Numbdatayes dbkeeper log', 0)

GO

Referenc

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/

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report