現象
Microsoft SQL Server 2012 または SQL Server 2014 を使用していることを前提としています。 リモート BLOB ストレージ (RBS) メンテナを実行すると、RBS メンテナ ツールが失敗し、次のエラー メッセージが表示されます。
注
メンテナ タスクの開始。
ガベージ コレクションの開始。
参照スキャンの開始。
このデータベースのリファレンス スキャンは完了です。
113 個の BLOB をスキャンしました。 0x000000000000000000000000(exclusive) から 0x00000000000000b600000002(包括) の範囲内の 0 個の BLOB を削除しました。
このタスクは終了しました。 合計 1 つの作業単位を処理しました。 0 作業単位が不完全でした。
削除の伝達を開始します。
現時点では作業は使用できません。
他のクライアント、プロセス、またはスレッドは現在、他のタスクで作業している可能性があります。
エラーが発生したため、現在の作業単位をスキップする。 詳細については、RBS メンテナ ログを参照してください。
[..]
このタスクは終了しました。 合計 102 個の作業単位を処理しました。 101 作業単位が不完全でした。 0 個の BLOB を削除する必要があります。 0 個の BLOB の削除に成功し、BLOB ストアに 0 個の BLOB が見つかりませんでした。
このタスクは終了しました。
このタスクは終了しました。
Profiler を使用して問題をトレースすると、次のエラー メッセージが表示されます。
注
Msg 50000、レベル 16、状態 0、プロシージャ rbs_sp_rethrow_error、38 行目
RBS エラー。 元のエラー: 数値 535、重大度 16、状態 0、プロシージャ rbs_sp_count、52 行目、
メッセージ: datediff 関数によってオーバーフローが発生しました。 2 つの日付/時刻インスタンスを区切る dateparts の数が多すぎます。 datepart の精度が低い datediff を使用してください。
原因
この問題は、最後の実行からの時間をチェックするクエリが値をミリ秒に変換したときにオーバーフローする可能性があるために発生します。 これにより、クエリが失敗し、データを処理せずにタスクが終了します。
解決策
この問題の修正プログラムは、RBS.msi 用の最新の機能パックダウンロードで入手できます。 RBS の既存のインストールがある場合は、「回避策」セクションに記載されているスクリプトを実行して、問題を一時的に解決することをお勧めします。
Microsoft SQL Server 2014 Service Pack 2 (SP2) 機能パックをダウンロードする
Microsoft SQL Server 2012 Service Pack 4 (SP4) 機能パックをダウンロードする
回避策
SQL SERVER 2012 または SQL Server 2014 に RBS の既存のインストールがあり、修正プログラムがインストールされていない場合は、次の回避策の手順を使用できます。
SSMS で、手順 3 からスクリプトを開き、修正プログラムを適用する RBS クライアント データベースをホストするSQL Server インスタンスに接続します。
スクリプトで、"your_RBS_client_database" 文字列を RBS クライアント データベースの実際の名前に置き換えます。
スクリプトを実行して修正プログラムを適用します。
[your_RBS_client_database] を使用する
行くobject_id(N'mssqlrbs_resources.rbs_sp_count') が null でない場合
drop プロシージャ mssqlrbs_resources.rbs_sp_count
行くcreate procedure mssqlrbs_resources.rbs_sp_count (
smallint @operation、
smallint = 0 @object、
@value bigint = null,
@start_time datetime = null、
@end_time datetime = null,
@description sysname = N''',
@message nvarchar(max) = null
)
方法
begintinyint @type 宣言します。
@secondsUsed ビット、
float の@secondsint = 10 @maxDays 宣言します。
存在しない場合 (
mssqlrbs_resources.rbs_internal_counters から * を選択します
where operation = @operation and object = @object and description = @description
)
raiserror (RBS の N'Internal エラー。 無効なパフォーマンス カウンターのカウントを試みます。 カウンター: <%d>.<%d>.<%s>.',
16、101、 @operation、 @object、 @description)選択
@type = 型、
@secondsUsed = seconds_used
コード体系
mssqlrbs_resources.rbs_internal_counters
ここで、
operation = @operation と
object = @object と
description = @description!= 0 @object 場合
begin
@valueが null の場合
raiserror (RBS の N'Internal エラー。 パフォーマンス カウンター <%d>.< に指定されていない値%d>.<%s>.',
16、103、 @operation、 @object、 @description)
end@secondsUsed = 1 の場合
begin
(@start_time が null の場合)
raiserror (RBS の N'Internal エラー。 パフォーマンス カウンターの開始時刻 <%d>.<%d>.<%s>.',
16、102、 @operation、 @object、 @description)set @end\_time = isnull(@end_time, getutcdate())
if (@start_time >@end\_time)
raiserror (RBS の N'Internal エラー。 開始時刻は終了時刻の後です。 カウンター: <%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(ミリ秒, @start\_time, @end\_time)) / 1000
end
endupdate mssqlrbs_resources.rbs_internal_counters
設定
count = count + 1,
value = value + @value,
squared_value = squared_value + square(@value),
min_value = ケース
min_valueが null の場合 @value
(@value < min_value) @value
else min_value
終わり
max_value = case
max_valueが null の場合 @value
when (@value > max_value) then @value
else max_value
終わり
last_value = @value、
seconds = seconds + @seconds,
squared_seconds = squared_seconds + square(@seconds)
min_seconds = case
min_secondsが null の場合 @seconds
when (@seconds < min_seconds) then @seconds
else min_seconds
終わり
max_seconds = case
max_secondsが null の場合 @seconds
when (@seconds > max_seconds) @seconds
else max_seconds
終わり
last_seconds = @seconds、
last_update_time = getutcdate()
last_message = @message
ここで、
operation = @operation と
object = @object と
description = @descriptionend
行く
状態
Microsoft は、これが "適用対象" セクションに記載されている Microsoft 製品の問題であることを確認しました。