Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵狀

假設您正嘗試使用 SQL Server 2017 中的 [取代] 選項來還原資料庫。 如果 filepath 包含 [建立資料庫] 中的多餘路徑分隔符號,您可能會收到如下所示的錯誤訊息:

Msg 3634、Level 16、State 1、Line LineNumber

作業系統傳回錯誤 ' 32 (程式無法存取檔案,因為另一個處理常式正在使用該檔案)」 在「FilePath \FileName. .mdf ' 上嘗試「RestoreContainer:: ValidateTargetForCreation '。

Msg 3156、Level 16、State 8、Line LineNumber

無法將檔案 "FileName" 還原為「FilePath \FileName. .mdf」。 使用 [移至] 來識別檔案的有效位置。

Msg 3634、Level 16、State 1、Line LineNumber

作業系統傳回錯誤 ' 32 (程式無法存取檔案,因為另一個處理常式正在使用該檔案)」 在 [FilePath \FileName.] 中嘗試 "RestoreContainer:: ValidateTargetForCreation"。

Msg 3156、Level 16、State 8、Line LineNumber

無法將檔案 "FileName" 還原為「FilePath \FileName. .ldf」。 使用 [移至] 來識別檔案的有效位置。

Msg 3119、Level 16、State 1、Line LineNumber

規劃 RESTORE 語句時發現問題。 先前的訊息提供詳細資料。

Msg 3013、Level 16、State 1、Line LineNumber

還原資料庫異常終止。

因應措施

當您嘗試使用 [取代] 選項執行還原時,就會出現這個錯誤。 作為因應措施,您可以刪除現有的資料庫並執行還原。

解決方案

此問題已在下列 SQL Server 累積更新中修正:

       SQL Server 2017 的累積更新4

每個新的 SQL Server 累計更新都包含所有的修正程式,以及前一個累積更新中所包含的所有安全性修正程式。 查看 SQL Server 的最新累計更新:

SQL Server 2017 的最新累計更新

其他相關資訊

關於路徑來說,它不是備份位置的路徑,而是備份標頭中的檔案路徑,只能透過 [還原標頭] 進行查看。 如需詳細資訊,請參閱 RESTORE 語句-HEADERONLY (transact-sql)。 例如:

RESTORE HEADERONLY

FROM DISK = N'FilePath\FileName.bak'

WITH NOUNLOAD;

GO

狀態

Microsoft 已確認<適用於>一節中所列的 Microsoft 產品確實有上述問題。

參考

瞭解 Microsoft 用於描述軟體更新的 詞彙

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×