We have a daily log restore to a secondary database. For one reason or another, we have problems getting all the user connections to be automatically disconnected before the restore starts and so sometimes we get the restore failing with the error 1010 "could not get exclusive access to the database".

The weird thing is, the restore log attempts to start at 9.30pm, but it takes all the way until 4.15am before the job actually fails. It seems that redgate doesn't realize for 7 hours that it can't start the restore.

Why does it take so long for it to report a failure?

It's kind of a bummer because if it failed within 20mins of starting, I would still be awake to manually restart it!

Any thoughts? I'm actually using SQL Backup 6.5 (sorry i know this is the SQL 7 forum - couldn't see one for 6.5).

Could you please post the contents of the SQL Backup log file for the restore process that failed? The default folder where the logs are stored is C:\\Documents and Settings\\All Users\\Application Data\\Red Gate\\SQL Backup\\Log\\<instance name> on Windows 2003 and older, and C:\\ProgramData\\Red Gate\\SQL Backup\\Log\\<instance name> on Windows Vista and newer.

Here is the log. The names have been changed to protect the innocent. javascript:emoticon(':roll:') Failed_LS is the target database for the restore, and server2 is the Windows Server 2003 the instance is on.

I included only a partial list of the connections that were listed because I didn't want to go through changing all of them. There are a number that are shown as connected to the database we are trying to restore to but immediately before i start the restore I kill all the connections to that database. The connections listed for the restore DB are therefore created in the intervening 6 hours that the restore is failing - i checked the last batch time for all of them.

If you can figure out why it seems the restore still does not work despite the disconnect_existing, and my kill spids routine that would be a bonus. I've also tried having a trigger on the database to disallow any connections for 5 mins around the time the restore starts and that didn't work either.

By default, SQL Backup would only wait 30 seconds for SQL Server to start the restore, before it aborts the process. In this case, it waited almost 7 hours. What is the VDITimeout value in the HKEY_LOCAL_MACHINE\\SOFTWARE\\Red Gate\\SQL Backup\\BackupSettingsGlobal\\[InstanceName] registry node?

The value is 24576 which would be 6.8 hours (I assume that is in seconds) so it seems to make sense. I have no idea why that would be set to such a high value. I switched it to 30 so we'll see what happens with that.