We had a power outage on one of our hosts, and it unfortunately caused some problems on two of our database servers. Fortunately this is a DEV environment - but we have some fairly large projects in development and so we needed to salvage whatever we could.
One server is our primary database server for applications; the other is a reporting server that contains some report oriented databases, as well as log shipped copies of the application databases from the primary. The primary server had a few databases go corrupt - fortunately we had backups. The reporting server had master go corrupt; but no other corruption as far as I could determine. I ended up recreating master from command line, since the backup drive was still down.
The issue I am having is on the reporting server. When I try to attach a database, I get an error stating that SQL cannot write to the MDF file, access denied. However, I am able to restore databases putting the files in the same folder with no issue. If I copy the MDF file to a different folder on the same drive, I can attach it without issue. I've reviewed the security on both folders and they are identical.
We do have transparent data encryption enabled on the server - however, that all seems to be working correctly. I can attach the databases once they're in the new folder, and I can log ship from primary... I don't see how that would make it matter where the file is physically located.
One thought was that perhaps there is still a file lock from SQL Server going down, but the server has been restarted multiple times since the incident - and also that would prevent (or at least throw a popup) when trying to move the files, so I doubt that is it.
At the end of the day, I don't really care that the files are in a new folder; but I'd like to understand the issue in case something like this happens in production.