分類
系統管理

SQL Server Exit code: -2061893606

錯誤描述

在 Windows 11 安裝 SQL Server 2022 Express Edition 時,安裝到最後快結束時,出現如下的錯誤訊息:

無法安裝 SQL Server (setup.exe)。
Exit code (Decimal): -2061893606
Error description: 等候 Database Engine 復原控制代碼失敗。請查看 SQL Server 錯誤記錄檔,以了解可能的原因。

發生原因

本案例發生的原因在於 SQL Server 安裝所在的磁碟磁區大小超過4KB,導致無法安裝。檢查方式以系統管理員身分執行「命令提示字元」,並執行下列指令:

fsutil fsinfo sectorinfo c:

執行指令後可得類似下列的結果:

LogicalBytesPerSector :                   512
PhysicalBytesPerSectorForAtomicity :      65536
PhysicalBytesPerSectorForPerformance :    65536
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
裝置對齊 :                          已對齊 (0x000)
裝置上的磁碟分割對齊 :               已對齊 (0x000)

其中「PhysicalBytesPerSectorForAtomicity」及「PhysicalBytesPerSectorForPerformance」都是 65536,代表每個磁區都64KB。

解決方法

先到控制台解除 Microsoft SQL Server的安裝,並且以系統管理員的權限刪除 C:\Program Files\Microsoft SQL Server 及 C:\Program Files (32)\Microsoft SQL Server 的資料夾

以系統管理員身分執行「Windows PowerShell」,並執行下列指令:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name "ForcedPhysicalSectorSizeInBytes" -PropertyType MultiString -Force -Value "* 4096"

上面指令會建立強制更改磁區為 4KB 的機碼。
重新開機後,再次以系統管理員身分執行「命令提示字元」,並執行下列指令:

fsutil fsinfo sectorinfo c:

此時可以看見如下的執行結果,其中「PhysicalBytesPerSectorForAtomicity」及「PhysicalBytesPerSectorForPerformance」都改為 4096,代表每個磁區都「模擬」成 4KB。

LogicalBytesPerSector :                   512
PhysicalBytesPerSectorForAtomicity :      4096
PhysicalBytesPerSectorForPerformance :    4096
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
裝置對齊 :                          已對齊 (0x000)
裝置上的磁碟分割對齊 :               已對齊 (0x000)

接著重新安裝 Microsoft SQL Server 2022 Express,便可以成功安裝。

分類
資訊安全

CTF 學習資源

線上資料

分類
程式設計

C++ 程式設計資源

線上解題

網路文件

書籍清單

  • Rao, S. (2017). Sam Teach Yourself C++ in One Hour a Day, 8th Edition (using C++14 & C++17). US: Pearson
  • Deitel, P. & Deitel, H. (2016). C++ How to Program, 10th Edition (using C++14). US: Pearson
  • Horton, I. & Weert, P.V. (2018). Beginning C++17: From Novice to Professional, 5th Edition. US: Apress
  • Prata, S. (2012). C++ Primer Plus, 6th Edition (using C++11). US: Addison-Wesley
  • Lippman, S.B., Jajoie, J. & Moo, B.E. (2013). C++ Primer, 5th Edition (using C++11). US: Addison-Wesley
  • Stroustrup, B. (2014). Programming: Principles and Practice Using c++, 2nd Edition (using C++11 & C++14). US: Pearson
  • Josuttis, N.M. (2012). The C++ Standard Library: A Tutorial and Reference, 2nd Edition (using C++11). US: Addison-Wesley
分類
其他

Hello, Friends !

您好:
這裡是阿道學習與生活的記錄!
歡迎您的到來,與我共享這些訊息!