使用 Microsoft 登入
登入或建立帳戶。
您好:
選取其他帳戶。
您有多個帳戶
選擇您要用來登入的帳戶。

徵狀

假設您使用的是 Microsoft SQL Server 2012 或 SQL Server 2014。 當您執行遠端 BLOB 儲存(RBS) Maintainer 時,RBS Maintainer 工具會失敗,而且您會收到下列錯誤訊息:

開始 Maintainer 工作。 啟動垃圾收集。 開始進行參照掃描。 此資料庫的參照掃描已完成。 已掃描113個 blob。 已將0x000000000000000000000000 (exclusive)範圍中的0個 blob 刪除至0x00000000000000b600000002 (含)。 此任務已結束。 已處理1個工時單位合計。 0個工時單位不完整。 開始刪除傳播。 目前沒有可用的工作。 其他用戶端、進程或執行緒目前可能正在處理其他任務。 因發生錯誤而略過目前的工作單元。 如需詳細資訊,請參閱 RBS Maintainer 記錄。 [..] 此任務已結束。 已處理102個工時單位合計。 101工時單位不完整。 需要刪除0個 blob。 已成功刪除0個 blob,但在 blob 存放區中找不到0個 blob。 此任務已結束。此任務已結束。

當您使用 Profiler 追蹤問題時,您會收到下列錯誤訊息:

Msg 50000、Level 16、State 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. 在腳本中,以 RBS 用戶端資料庫的實際名稱取代「your_RBS_client_database」字串。

  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 管理員將能夠收集這些資料。 隱私權聲明。

感謝您的意見反應!

×