At work we have a productive SQL Server working, and we create backups of each database periodically, including system databases master, msdb and model.
I'm trying to restore the whole datawarehouse into another SQL Server instance as a test, to write documentation in case of total loss. I was able to restore the datawarehouse databases, msdb and model, but the problem started when I restored master.
I restored it in single-user mode, with replace
and it worked, but then my SQL Server instance stopped and now I can't restart it.
It says something like 'request error or the service did not response in time'. I've checked the log folder and here's a part of the error message:
Service Master Key could not be decrypted using one of its encryptions. See sys.key_encryptions for details.
An error occurred during Service Master Key initialization. SQLErrorCode=33095, State=8, LastOsError=0.
And
Open failed: Could not open file C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\MSDBData.mdf for file number 1. OS error
For each of the databases.
Is a restore of the master database necessary or can I pass on it? What will I lose?
Hope you guys can help me with this issue, and sorry for my English.
master
you often need to backup/restore the SMK also. Try rebuildingmaster
learn.microsoft.com/en-us/sql/relational-databases/databases/… and then restore the SMK, then try restoremaster
again.ALTER SERVICE MASTER KEY REGENERATE
but that probably won't help your issue. You need to back it up and restore as mentioned.