SQL Server services are not starting or not coming online
SQL Server services are not coming online and throwing below error in the eventvwr. So we need to bring it online with single-user mode.
Error:
=> SQL services were not coming up as it was failing with the below errors for all the System databases:
FCB::Open failed: Could not open file d:\dbs\sh\sprel\0822_164025\
2020-12-22 19:37:05.47 spid15s Starting up database 'mssqlsystemresource'.
2020-12-22 19:37:05.47 spid7s Error: 5120, Severity: 16, State: 101.
2020-12-22 19:37:05.47 spid7s Unable to open the physical file "d:\dbs\sh\sprel\0822_164025\
2020-12-22 19:37:05.47 spid7s Error: 17207, Severity: 16, State: 1.
MSSQLSERVER_17204 - SQL Server | Microsoft Docs
=>We modified the physical location of the files to point to the right one :
Move System Databases - SQL Server | Microsoft Docs
1) Start service in single mode:
Because we didn't have information in master database, we were not able to login using any login. We used the below command that could help us to use sqlcmd utility
net start MSSQLSERVER /T3608 /f /m"SQLCMD"
2)Use the below command to modify files location to point to the right one:
ALTER DATABASE database_name MODIFY FILE( NAME = logical_name , FILENAME = 'new_path\os_file_name' )
3)Exit the sqlcmd utility
4))Stop the instance of SQL Server.
NET STOP MSSQLSERVER
.
5)Restart the instance of SQL Server.
Comments