我不相信有内置复制存储过程来检查快照代理状态,我可能是错的。但是,您可以查询 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 查看快照代理作业的状态。