使用 Microsoft 登录
登录或创建帐户。
你好,
使用其他帐户。
你有多个帐户
选择要登录的帐户。

症状

假设您使用的是 Microsoft SQL Server 2012 或 SQL Server 2014。 当你运行远程 BLOB 存储(RBS) Maintainer 时,RBS Maintainer 工具将失败,并且你会收到以下错误消息:

正在启动 Maintainer 任务。 开始垃圾回收。 开始进行引用扫描。 此数据库的引用扫描已完成。 已扫描113个 blob。 已删除0x000000000000000000000000 (独占)范围内的0个 blob 到0x00000000000000b600000002 (包含)。 此任务已结束。 已处理1个工时单位总计。 0个工时单位不完整。 开始删除传播。 目前没有可用的工作。 其他客户端、进程或线程当前可能正在处理其他任务。 由于出现错误而跳过当前工作单元。 有关详细信息,请参阅 RBS Maintainer 日志。 [..] 此任务已结束。 已处理102工时单位总计。 101工作单位不完整。 需要删除0个 blob。 已成功删除0个 blob,在 blob 存储中找不到0个 blob。 此任务已结束。此任务已结束。

使用 Profiler 跟踪问题时,将收到以下错误消息:

消息50000、级别16、状态0、过程 rbs_sp_rethrow_error、行38RBS 错误。 原始错误:数字535、严重级别16、状态0、过程 rbs_sp_count、第52行、消息: datediff 函数导致溢出。 分隔两个日期/时间实例的 dateparts 数太大。 尝试使用不太精确的日期部分的 datediff。

原因

出现此问题的原因是检查自上次执行后的时间的查询可能会在将值转换为毫秒时发生溢出。 这将导致查询失败,并且任务将终止,而不处理数据。

解决方案

针对 RBS 的最新功能包下载提供了此问题的修补程序。 如果你已有 RBS 的现有安装,我们建议你运行 "解决方法" 部分中提供的脚本以暂时修复该问题。

下载 MICROSOFT Sql server 2014 Service pack 2 (SP2)功能包 下载 microsoft Sql Server 2012 Service PACK 4 (SP4)功能包

解决方法

如果在未安装修补程序的 SQL Server 2012 或 SQL Server 2014 上已有 RBS 的现有安装,则可以使用以下解决方法步骤:

  1. 在 SSMS 中,打开步骤3中的脚本,然后连接到要对其应用修补程序的 RBS 客户端数据库所在的 SQL Server 实例。

  2. 在脚本中,将 "your_RBS_client_database" 字符串替换为 RBS 客户端数据库的实际名称。

  3. 运行脚本以应用修补程序。use [your_RBS_client_database]go if object_id(N'mssqlrbs_resources.rbs_sp_count') is not null drop procedure mssqlrbs_resources.rbs_sp_countgo create procedure mssqlrbs_resources.rbs_sp_count ( @operation smallint, @object smallint = 0, @value bigint = null, @start_time datetime = null, @end_time datetime = null, @description sysname = N'', @message nvarchar(max) = null)asbegin declare @type tinyint, @secondsUsed bit, @seconds float declare @maxDays int = 10; if not exists ( select * from mssqlrbs_resources.rbs_internal_counters where operation = @operation and object = @object and description = @description ) raiserror (N'Internal error in RBS. Attempt to count invalid performance counter. Counter: <%d>.<%d>.<%s>.', 16, 101, @operation, @object, @description) select @type = type, @secondsUsed = seconds_used from mssqlrbs_resources.rbs_internal_counters where operation = @operation and object = @object and description = @description if @object != 0 begin if @value is null raiserror (N'Internal error in RBS. Value not specified for performance counter <%d>.<%d>.<%s>.', 16, 103, @operation, @object, @description) end if @secondsUsed = 1 begin if (@start_time is null) raiserror (N'Internal error in RBS. Start time not specified for performance counter <%d>.<%d>.<%s>.', 16, 102, @operation, @object, @description) set @end_time = isnull(@end_time, getutcdate()) if (@start_time > @end_time) raiserror (N'Internal error in RBS. Start time is after end time. Counter: <%d>.<%d>.<%s>.', 16, 104, @operation, @object, @description) if (datediff(day, @start_time, @end_time) >= @maxDays) begin set @seconds = convert(float, datediff(second, @start_time, @end_time)) end else begin set @seconds = convert(float, datediff(millisecond, @start_time, @end_time)) / 1000 end end update mssqlrbs_resources.rbs_internal_counters set count = count + 1, value = value + @value, squared_value = squared_value + square(@value), min_value = case when min_value is null then @value when (@value < min_value) then @value else min_value end, max_value = case when max_value is null then @value when (@value > max_value) then @value else max_value end, last_value = @value, seconds = seconds + @seconds, squared_seconds = squared_seconds + square(@seconds), min_seconds = case when min_seconds is null then @seconds when (@seconds < min_seconds) then @seconds else min_seconds end, max_seconds = case when max_seconds is null then @seconds when (@seconds > max_seconds) then @seconds else max_seconds end, last_seconds = @seconds, last_update_time = getutcdate(), last_message = @message where operation = @operation and object = @object and description = @description endgo

状态

Microsoft 已确认这是在“适用范围”部分中列出的 Microsoft 产品存在的问题。

需要更多帮助?

需要更多选项?

了解订阅权益、浏览培训课程、了解如何保护设备等。

社区可帮助你提出和回答问题、提供反馈,并听取经验丰富专家的意见。

此信息是否有帮助?

你对语言质量的满意程度如何?
哪些因素影响了你的体验?
按“提交”即表示你的反馈将用于改进 Microsoft 产品和服务。 你的 IT 管理员将能够收集此数据。 隐私声明。

谢谢您的反馈!

×