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',
备份的主 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 固定服务器角色的成员才能运行此过程。
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈