飞不高 发表于 2024-10-18 12:53:00

window安装SQLServer数据库出现错误-数据库报错等待数据库引擎恢复句柄失败

window 在安装SQL Server数据库引擎末了一步的时间 启动数据库卡起很长一段时间末了以失败告终。错误提示是数据库报错等待数据库引擎恢复句柄失败。确实很懵就查询了一下。
通过查看文档和搜刮引擎查找解决方案
https://learn.microsoft.com/zh-CN/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size
最终查到是由于体系磁盘扇区大小大于 4 KB导致的问题,这里我们的解决方案是需要安装到哪个磁盘就改哪个磁盘的扇区为4kb。
查看磁盘

使用管理权限打开Windows PowerShell工具。
输入 fsutil fsinfo sectorinfo D: 此中d表现d盘的意思。我安装数据库到D盘中。
PS C:\Users\Administrator> fsutil fsinfo sectorinfo D:
LogicalBytesPerSector :                                 512
PhysicalBytesPerSectorForAtomicity :                  512
PhysicalBytesPerSectorForPerformance :                  512
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 512
设备校准 :                                        已校准(0x000)
设备上的分区校准:                                  已校准(0x000)
无搜寻惩罚
支持剪裁
不支持 DAX
未精简预配
如果查询的参数中返回效果 PhysicalBytesPerSectorForAtomicity 和 PhysicalBytesPerSectorForPerformance 不是4096大概安装不上会提示此错误-数据库报错等待数据库引擎恢复句柄失败。
修改扇区

修改设置扇区大小输入:
New-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device” -Name “ForcedPhysicalSectorSizeInBytes” -PropertyType MultiString -Force -Value “* 4095”

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


ForcedPhysicalSectorSizeInBytes : {* 4095}
PSPath                        : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi
                                  ces\stornvme\Parameters\Device
PSParentPath                  : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi
                                  ces\stornvme\Parameters
PSChildName                     : Device
PSDrive                         : HKLM
PSProvider                      : Microsoft.PowerShell.Core\Registry
查看修改效果
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name   "ForcedPhysicalSectorSizeInBytes"


ForcedPhysicalSectorSizeInBytes : {* 4095}
PSPath                        : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi
                                  ces\stornvme\Parameters\Device
PSParentPath                  : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servi
                                  ces\stornvme\Parameters
PSChildName                     : Device
PSDrive                         : HKLM
PSProvider                      : Microsoft.PowerShell.Core\Registry
修改之后需要重启电脑 .再执行 fsutil fsinfo sectorinfo D: 就先森4096了。
继续卸载SQLserver后重新安装。就能顺利的安装上数据库引擎。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: window安装SQLServer数据库出现错误-数据库报错等待数据库引擎恢复句柄失败