sp_cleanup_log_shipping_history (Transact-SQL)
適用於:SQL Server
此預存程式會根據保留期間,在本機和監視伺服器上清除歷程記錄。
語法
sp_cleanup_log_shipping_history
[ @agent_id = ] 'agent_id',
[ @agent_type = ] 'agent_type'
引數
[ @agent_id = ] 'agent_id',
備份的主要識別碼,或複製或還原的次要識別碼。 agent_id 是 uniqueidentifier ,而且不能是 Null。
[ @agent_type = ] 'agent_type'
記錄傳送作業的類型。 0 = 備份,1 = 複製,2 = 還原。 agent_type為 Tinyint ,不能為 Null。
傳回碼值
0 (成功) 或 1 (失敗)
結果集
無。
備註
sp_cleanup_log_shipping_history必須在任何記錄傳送伺服器上從 master 資料庫執行。 此預存程式會根據歷程記錄保留期間,清除log_shipping_monitor_history_detail 和 log_shipping_monitor_error_detail 的 本機和遠端複本。
權限
只有系統管理員 固定伺服器角色的成員 才能執行此程式。
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應