我想在使用此语句启动代理后检查代理的状态
EXEC sp_startpublication_snapshot @publication
因为我想做下一步,需要工作已经开始。
最佳答案
我不相信有一个内置的复制存储过程来检查快照代理状态,我可能是错的。但是,您可以查询 MSsnapshot_history。像这样的东西应该可以解决问题:
SELECT
agent_id,
runstatus,
start_time,
time,
duration,
comments,
delivered_transactions,
delivered_commands,
delivery_rate,
error_id,
timestamp
FROM dbo.MSsnapshot_history
WHERE comments = 'Starting agent.'
同样,您可以检查快照代理何时完成:
SELECT
agent_id,
runstatus,
start_time,
time,
duration,
comments,
delivered_transactions,
delivered_commands,
delivery_rate,
error_id,
timestamp
FROM dbo.MSsnapshot_history
WHERE comments = '[100%] A snapshot of 68 article(s) was generated.'
或者,您可以使用 sp_help_job 查看快照代理作业的状态。
关于sql - 如何查看复制快照代理状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25034968/