The process could not execute 'sp_repldone/sp_replcounters' on 'ServerName'
昨天发现发布服务器S(SQL Server 2008 R2),出现大量如下错误
错误细节如下所示:
Date 10/16/2013 4:04:14 PM Log SQL Server (Current - 10/16/2013 3:44:00 PM) Source spid52 Message Replication-Replication Transaction-Log Reader Subsystem: agent xxxxx failed. The process could not execute sp_repldone/sp_replcounters on ServerName.
我在发布服务器S上启用Launch Replication Monitor(复制监视器),查看一些具体情况,如下所示
Error messages: The process could not execute sp_repldone/sp_replcounters on ServerName. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011) Get help: http://help/MSSQL_REPL20011 The specified LSN {00000000:00000000:0000} for repldone log scan occurs before the current start of replication in the log {000988e1:0000577e:00b4}. (Source: MSSQLServer, Error number: 18768) Get help: http://help/18768 The process could not set the last distributed transaction. (Source: MSSQL_REPL, Error number: MSSQL_REPL22017) Get help: http://help/MSSQL_REPL22017 The process could not execute sp_repldone/sp_replcounters on ServerName. (Source: MSSQL_REPL, Error number: MSSQL_REPL22037) Get help: http://help/MSSQL_REPL22037
另外发现Log Reader Agent(日志读取器代理)呈现错误状态,首先尝试通过关闭Log Reader Agent(日志读取器代理),然后重启Log Reader Agent(日志读取器代理),Log Reader Agent(日志读取器代理)依然启动不了,重启SQL Server Agent(SQL Server 代理),问题仍然存在,检查msrepl_commands记录数,当时记录数是761490,可以排除颁发库的 msrepl_commands 表里面的数据太多,导致清理花费太长时间的原因。
SELECT COUNT(1) FROM msrepl_commands
于是执行下面SQL:
EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1 EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 0 exec sp_replflush
SQL执行完成后,日志读取器代理成功启动。重启初始化订阅后,问题解决。
下面是MSDN关于sp_repflush 和sp_repldone的解释:
sp_replflush 用于事务复制。
为了提高效率,项目定义存储在缓存中。只要修改或删除项目定义,其他复制存储过程都可使用 sp_replflush。
只有一个客户端连接有权访问给定数据库的日志读取器。如果某个客户端有权访问数据库的日志读取器,则执行 sp_replflush 将导致该客户端释放其访问权。这样一来,其他客户端就能使用 sp_replcmds 或 sp_replshowcmds 扫描事务日志了
sp_repldone 用于事务复制。
sp_repldone 由日志读取器进程用来跟踪哪些事务已分发。
使用 sp_repldone,您可以手动通知服务器事务已复制(即已发送到分发服务器)。它还允许您更改被标记为下一个等待复制的事务。您可以在已复制事务的列表中前后移动。(所有小于或等于该事务的事务都将标记为已分发。)
可以使用 sp_repltrans 或 sp_replcmds 获得所需的参数 xactid 和 xact_seqno。
SQL Server使用侦听器IP访问时遇到 The target principal name is incorrect. Cannot generate SSPI context 原文:SQL Server使用侦听器IP访问时遇到 The target principal name is incorrect. Cannot generate SSPI context 在测试SQL Server 2016 Always On时,在创建侦听器后,在客户端使用SSMS, 可以用侦...
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled 测试环境:OEL6.5+Oracle 11g R2在进行执行计划测试的时候,遇到一个小问题。在用普通用户执行下面这条命令的时候,普通用户名为hhu,已经赋予了create session和resource权限。
潇湘隐者 网名潇湘隐者/潇湘剑客、英文名Kerry,兴趣广泛,广泛涉猎,个性随意,不善言辞。执意做一名会写代码的DBA,混迹于IT行业
相关文章
- MacOS安装Eclipse后启动报错:The JVM shared library "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/../lib/server/libjvm.dylib" does not contain the JNI_CreateJavaVM symbol.
- Mysql 的异常:The last packet successfully received from the server was 90 milliseconds ago. The last packet sent successfully to the server was 43,603,303 milliseconds ago. is longer than the server con
- 【异常】The dependencies of some of the beans in the application context form a cycle
- 【异常】[ERROR] The cloud assistant is not installed on the ECS, or the cloud assistant is unavailable. cloudassistant is uninstall
- Fielddata is disabled on text fields by default. Set fielddata=true on [gender] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memor
- Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen
- java错误:The superclass "javax.servlet.http.HttpServlet" was not found on the Java Bu
- SQLBackupAndFTP The server principal "NT AUTHORITYSYSTEM" is not able to access the database "xxxx"
- poj 1386 Play on Words(有向图欧拉回路)
- ArcGIS Server启动服务报:ERROR: Unable to start Xvfb on any port in the range 6600 - 6619
- the network bridge on device vmnet0 is not running解决方法
- [Functional Programming] Transition State based on Existing State using the State ADT (liftState, composeK)
- [React Native] Prevent the On-screen Keyboard from Covering up Text Inputs
- Install ssdb-rocks on CentOS 6
- Warning: Using a password on the command line interface can be insecure.
- [Next.js] Consume Next.js API routes with the SWR library on the client-side
- [服务器时区问题]PHP Warning: strftime(): It is not safe to rely on the system's timezone set
- AndroidStudio3.0 注解报错Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.
- The resource could not be loaded because the App Transport Security policy requires the use of a sec
- 解决The type or namespace name 'XXXX' does not exist in the namespace 'XXXXXXXXX' 的错误
- 成功解决404 Not Found Not Found The requested URL was not found on the server. If yo
- 已解决RuntimeError: CUDA error: no kernel image is available for execution on the device
- 【问题解决】The connection to the server localhost:8080 was refused
- 解决办法:错误异常The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Linux|错误集锦|prometheus Error on ingesting samples that are too old or are too far into the future的解决
- 【异常】FlinkException: The module flink-runtime-web could not be found in the class path
- Failed to replace a bad datanode on the existing pipeline due to no more good datanodes being avail