We have quite a few programs of our own design which communicate to our SQL Server (SQL Server 2014 Express). Every now and then they start blowing up all over the place; we run around trying to figure out what’s wrong, only to open up SQL Server Management Studio and find that our database isn’t running.
To be more specific: we open SSMS, expand the “Databases” node and it says:
[DATABASE NAME] (Recovery Pending)
Opening the SQL Server Configuration Manager and restarting the service for the down database fixes the problem and everything starts to work again… for a while.
After running across this problem a few times, I’ve noticed that it only happens after we reboot the server- though not every time. Meaning that sometimes when the server boots up, SQL fails to do the same. An interesting fact is that we have multiple databases running on the SQL server and they don’t go down together; one of the databases might say “(Recovery Pending)” while the other one works fine.
I have not been able to find a solution to this problem- or even a cause. Any ideas?
After going through the server’s event logs I found this:
Log Name: Application
Event ID: 17204
Task Category: Server
FCB::Open failed: Could not open file C:Program FilesMicrosoft SQL ServerMSSQL12.SQLEXPRESSMSSQLDATADuraDB.mdf for file number 1. OS error: 32(The process cannot access the file because it is being used by another process.).
What would be causing the file to lock, especially after a reboot?