Is there any way to recover a SQL database from Standby/Read-Only mode if the "standby file" is missing?
(I see some references calling this a TUF file in a log-shipping scenario, but in my case, it was just a manual restore and the standby file had a BAK extension.)
Doing a "RESTORE DATABASE foo WITH RECOVERY" results in a fatal error:
During startup of warm standby database 'foo', its standby file ('path\filename.bak') was inaccessible to the RESTORE statement. The operating system error was '5(Access is denied.)'. Diagnose the operating system error, correct the problem, and retry startup.
The restore was done a while ago, and unfortunately the standby file was in the backup folder and got removed by our folder cleanup routine. No copy of the file exists on any other media. The original backups that were used to restore to this point are also long gone.
Fortunately this isn't a big deal for us (it was a temp restore), but I couldn't find any other useful references out there on this question, other than "don't remove that file".
If it came down to it, I suppose I could script out the entire database, or use SSIS to copy all objects to a new database container, since I have a read-only copy of the db in front of me.
Any way to fix this issue? I certainly don't expect that I'd be able to flip it back to "restoring" and continue doing subsequent restores or anything, I'd just like to force it into normal online mode in its current state, so that I can do things like change permissions, or change the recovery mode, or take a new full backup or something.