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_type为 tinyint,不能为 NULL。

返回代码值

0(成功)或 1(失败)

结果集

无。

注解

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

权限

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

另请参阅

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