前阵子一数据库服务器的事务日志开始暴增,当时使用下面脚本检查发现该数据库的log_reuse_wait_desc 一直处于replication状态, 也就是说在事务复制过程中,与发布相关的事务仍未传递到分发数据库。刚好前一天有个同事配置了aws的dms相关作业。
select name, log_reuse_wait_desc from sys.databases;
找到具体作业检查发现,该作业的第二步出现了错误,logreader服务启动失败了。如需截图所示:
message
unable to start execution of step 2 (reason: the logreader subsystem failed to load [see the sqlagent.out file for details]; the job has been suspended). the step failed.
进一步检查sql server agent的日志输出,发现是因为“because the queuereader subsystem failed to load”
date 2018/11/15 14:54:41
log sql server agent (archive #1 - 2018/11/20 9:11:00)
message
[log] step 2 of job 'xxxx' (0xe00dff76d02dad47920124dd907a412d) cannot be run because the logreader subsystem failed to load. the job has been suspended
date 2018/11/15 14:54:44
log sql server agent (archive #1 - 2018/11/20 9:11:00)
message
[log] step 2 of job 'xxxx' (0x1bc045267cae2f4a8c3e283921f40641) cannot be run because the queuereader subsystem failed to load. the job has been suspended
使用下面脚本检查,发现子系统queuereader的dll是存在的,刚好同事前一天配置aws时,在sql server里面添加了replication相关组件。而添加组件后,没有重启sql server agent服务。重启sql server agent服务后,问题解决!
select * from msdb.dbo.syssubsystems
参考资料:
https://www.sqlservercentral.com/forums/783200/replication-subsystems-failed-to-load