sp_cleanup_log_shipping_history (Transact-SQL)

适用于:SQL Server

此存储过程将根据保持期,清理本地和监视服务器上的历史记录。

Transact-SQL 语法约定

语法

  
sp_cleanup_log_shipping_history  
[ @agent_id = ] 'agent_id',  
[ @agent_type = ] 'agent_type'  

自变量

[ @agent_id = ] 'agent_id', 备份的主 ID 或用于复制或还原的辅助 ID。 agent_id为 uniqueidentifier,不能为 NULL。

[ @agent_type = ] 'agent_type' 日志传送作业的类型。 0 = 备份,1 = 复制,2 = 还原。 agent_typetinyint ,不能为 NULL。

返回代码值

0(成功)或 1(失败)

结果集

无。

备注

必须 从任何日志传送服务器上的 master 数据库运行sp_cleanup_log_shipping_history。 此存储过程根据历史记录保留期清理 log_shipping_monitor_history_detaillog_shipping_monitor_error_detail 的本地和远程副本。

权限

只有 sysadmin 固定服务器角色的成员才能运行此过程。

另请参阅

关于日志传送 (SQL Server)
系统存储过程 (Transact-SQL)