September 2, 2021

MSSQL Server model.mdf 丟失不存在目錄下

FCB::Open failed: Could not open file C:\Program Files\Microsfot SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\model.mdf for file number1. OS error:2(The system cannot find the file specifed.)
MSSQL SERVER 服務無法啟動

Resolve:
直接從另一部SQL Server 複製 model*.mdf(model開頭的全copy就對了), copy到這台缺少檔案的SQL Server上, 再次啟動SQL Server的服務應該就可行了!

ps. 若在複製檔案過程中, 遇到SQL Server 運行中檔案被鎖定的狀況, 可試著先把SQL Server服務停止後, 可順利copy file.