昨天一台SQL Server 2008R2的数据库在凌晨5点多抛出下面告警信息:

The log scan number (620023:3702:1) passed to log scan in database 'xxxx' 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.

乍一看,还以为数据库损坏了(data corruption),但是在做完DBCC CHECKDB后,发现其实数据库其实是完好无损的。那么肯定是跟Replication有关。但是在搜索了相关资料,仅仅在The process could not execute ‘sp_repldone/sp_replcounters” 这篇博客中找到了类似错误的资料:

Common Causes
  • The last LSN in Transaction Log is less than what the LSN Log Reader is trying to find. An old backup may have been restored on top of Published Database. After the restore, the new Transaction Log doesn't contain the data now distributor & subscriber(s) have.
  • Database corruption.
How to fix this
  • Ensure database consistency by running DBCC CHECKDB on the database. 
  • If an old backup was restored on top of published database then use sp_replrestart
  • If going back to the most recent transaction log backup is not an option then execute sp_replrestart  on publisher in published database. This stored procedure is used when the highest log sequence number (LSN) value at the Distributor does match the highest LSN value at the Publisher.
  • This stored procedure will insert compensating LSNs (No Operation) in the publisher database log file till one the compensating LSN becomes more than the highest distributed LSN in distribution database for this published database. After this it inserts this new high LSN in the msrepl_transactions table in the distribution database and executes sp_repldone on published database to update the internal structures to mark a new starting point for log reader agent.
  • Ensure that the log reader agent is stopped and there is no incoming transactions on the published database, when this SP is executed.
  • Since transactions may have been lost, we recommend to reinitialize the subscriber(s) and/or recreate publication/subscription(s).  For large databases consider using “Initialize from Backup” as discussed in SQL Book Online.

但是在这个案例当中, 数据库既没有损坏,也没有还原过。 只能是Replication出现了错误,但是在SQL Server的Replication中又没有找到相关错误信息,本身这个是AWS的DMS自动生成的Replication,很多内部信息不太清楚(例如,是否出现异常),官方也没有找到很详细的介绍这个错误的相关资料。在此记录一下。

参考资料:

https://blogs.msdn.microsoft.com/repltalk/2010/02/19/the-process-could-not-execute-sp_repldonesp_replcounters/

The log scan number (620023:3702:1) passed to log scan in database 'xxxx' is not valid的更多相关文章

  1. mysql oom之后的page 447 log sequence number 292344272 is in the future

    mysql oom之后,重启时发生130517 16:00:10 InnoDB: Error: page 447 log sequence number 292344272InnoDB: is in ...

  2. 14.7.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量和大小

    14.7.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量和大小 改变 InnoDB ...

  3. 14.5.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量

    14.5.2 Changing the Number or Size of InnoDB Redo Log Files 改变InnoDB Redo Log Files的数量 改变InnoDB redo ...

  4. InnoDB: The log sequence number in ibdata files does not match

    InnoDB: The log sequence number in ibdata files does not matchInnoDB的:在ibdata文件的日志序列号不匹配 可能ibdata文件损 ...

  5. Thread <number> cannot allocate new log, sequence <number>浅析

    有时候,你会在ORACLE数据库的告警日志中发现"Thread <number> cannot allocate new log, sequence <number> ...

  6. resize2fs: Bad magic number in super-block while trying to open /dev/centos/root Couldn't find valid filesystem superblock

    今天在进行lvm扩容之后,按照惯例进行 resize2fs 操作,发现报如下错误: # resize2fs /dev/centos/root resize2fs 1.42.9 (28-Dec-2013 ...

  7. The transaction log for database 'xxxx' is full due to 'ACTIVE_TRANSACTION'

    今天查看Job的History,发现Job 运行失败,错误信息是:“The transaction log for database 'xxxx' is full due to 'ACTIVE_TRA ...

  8. Error: 9001, Severity: 21, State: 5 The log for database 'xxxx' is not available

    昨天下午5点多收到几封告警邮件,我还没有来得及看,GLE那边的同事就电话过来,说数据库出现告警了.让我赶紧看看,案例具体信息如下所示: 告警邮件内容: DATE/TIME: 2015/1/23 17: ...

  9. MySQL中的重做日志(redo log),回滚日志(undo log),以及二进制日志(binlog)的简单总结

    MySQL中有六种日志文件,分别是:重做日志(redo log).回滚日志(undo log).二进制日志(binlog).错误日志(errorlog).慢查询日志(slow query log).一 ...

随机推荐

  1. 对小程序框架WePY的精简总结

    一.注意点 关闭ES6转ES5关闭上传代码时样式自动补全关闭代码压缩上传本地开发选择dist目录,dist目录也用在开发者工具上实时预览和调试WePY框架对应的开发目录为src二.代码规范 - 变量方 ...

  2. Apache-Flink深度解析-概述

    摘要: Apache Flink 的命脉 "命脉" 即生命与血脉,常喻极为重要的事物.系列的首篇,首篇的首段不聊Apache Flink的历史,不聊Apache Flink的架构, ...

  3. kubernetes之收集集群的events,监控集群行为

    一.概述 线上部署的k8s已经扛过了双11的洗礼,期间先是通过对网络和监控的优化顺利度过了双11并且表现良好.先简单介绍一下我们kubernetes的使用方式: 物理机系统:Ubuntu-16.04( ...

  4. Cookie提要

    Cookie的基本概念和设置  Cookie在远程浏览器端存储数据并以此跟踪和识别用户的机制.从实现上说,Cookie是存储在客户端上的小段数据,浏览器(即客户端)通过HTTP协议和服务器端进行Coo ...

  5. python语法风格

    这里只给出其它文章里不适合出现部分语法风格. python有几种类型的复合语句:if.for.while.def.class.try/except.with/as等.这些复合类型的语句在编写时,要遵循 ...

  6. PPP中的PAP和CHAP的区别

    PAP PAP是简单认证,明文传送,客户端直接发送包含用户名/口令的认证请求,服务器端处理并回应. CHAP CHAP是加密认证,先由服务器端给客户端发送一个随机码 challenge,客户端根据 c ...

  7. golang使用chrome headless获取网页内容

    如今动态渲染的页面越来越多,爬虫们或多或少都需要用到headless browser来渲染待爬取的页面. 而最近广泛使用的headless browser解决方案PhantomJS已经宣布不再继续维护 ...

  8. 基础篇:8.如何定义变量?js变量有什么特点?

    书接上文,废话不多说,直接进入正题,下面我们一起来讨论js中的变量那些事! 那什么是变量? 变量是存储信息的容器,可以存储任何类型的数据. 如何定义变量呢? 变量可以使用短名称,如x,y:也可以是长名 ...

  9. ADO.NET基础学习 一(连接数据库)

    (记录下方便自己复习) 概念 简单地理解为用来连接数据库的类. 工作流程 ①Connection对象用来连接数据库. 两种连接方式:Windows身份验证 / sqlserver验证 private ...

  10. UML 概述

    UML统一建模语言      1997年OMG组织(Object Management Group对象管理组织)发布了统一建模语言(Unified Modeling Language,UML).它目标 ...