Share via


sp_refresh_log_shipping_monitor (Transact-SQL)

適用於:SQL Server

這個預存程式會使用指定記錄傳送代理程式之指定主要或輔助伺服器的最新資訊,重新整理遠端監視器數據表。 程式會在主要或輔助伺服器上叫用。

Transact-SQL 語法慣例

語法

  
sp_refresh_log_shipping_monitor  
[ @agent_id = ] 'agent_id',  
[ @agent_type = ] 'agent_type'  
[ @database = ] 'database'  
[ @mode ] n  

引數

[ @agent_id = ] 'agent_id' 備份的主要標識碼,或複製或還原的次要標識符。 agent_id是 uniqueidentifier,而且不能是 NULL。

[ @agent_type = ] 'agent_type' 記錄傳送作業的類型。

0 = 備份。

1 = 複製。

2 = 還原。

agent_type為 tinyint,不能為 NULL。

[ @database = ] 'database' 備份或還原代理程序記錄所使用的主要或輔助資料庫。

[ @mode ] n 指定是否要重新整理監視資料或清除它。 m數據類型為 tinyint,且支援的值為:

1 = 重新整理 (這是預設值。

2 = 刪除

傳回碼值

0 (成功) 或 1 (失敗)

結果集

無。

備註

sp_refresh_log_shipping_monitor使用尚未傳輸的任何會話資訊,重新整理log_shipping_monitor_primarylog_shipping_monitor_secondarylog_shipping_monitor_history_detaillog_shipping_monitor_error_detail數據表。 這可讓您在監視一段時間未同步處理時,將監視伺服器與主要或輔助伺服器同步處理。 此外,它可讓您在必要時清除監視伺服器上的監視資訊。

sp_refresh_log_shipping_monitor必須在主要或輔助伺服器上從 master 資料庫執行。

權限

只有系統管理員固定伺服器角色的成員才能執行此程式。

另請參閱

關於記錄傳送 (SQL Server)
系統預存程序 (Transact-SQL)