Failed Restore - Failed to disconnect existing connections

JoshDBGuyJoshDBGuy Posts: 16
edited January 14, 2013 12:50AM in SQL Backup Previous Versions
Hello,

A restore last night failed with an error message that contained the following information,

"Failed to disconnect existing connections to database."

This is the first of this failure I have seen. I am using the "DISCONNECT_EXISTING" command and from what I can tell there was no connection to that specific database at the time the restore ran. Subsequent restores of different databases worked fine after this restore failed. Any ideas?


Thanks,

J

Comments

  • peteypetey Posts: 2,358 New member
    Could you please post the contents of the SQL Backup log 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.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • I took care of that issue but maybe you can look at this one? Another failure, different DB (failed after 20 seconds), this restore does have kill connections enabled and it looks like this was set up with another script that runs prior to the restore that also kills connections,


    ERRORS AND WARNINGS


    1/5/2013 10:00:01 PM: Restoring XXXX_XXXX (database) from:
    1/5/2013 10:00:01 PM: \\XXXX\XXXX.sqb

    1/5/2013 10:00:05 PM: ALTER DATABASE [XXXX] SET ONLINE RESTORE DATABASE [XXXX] FROM VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX', VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX',
    VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX', VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX', VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX', VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX', VIRTUAL_DEVICE = 'SQLBACKUP_XXXXX' WITH BUFFERCOUNT = 28, BLOCKSIZE = 65536, MAXTRANSFERSIZE = 1048576 , RECOVERY, MOVE 'XXXXX' TO 'D:\XXXXX\XXXXX', MOVE 'XXXXX_log' TO
    'D:\XXXXX_log', REPLACE

    1/5/2013 10:00:38 PM: Thread 0 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:38 PM: Thread 1 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:38 PM: Thread 2 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:38 PM: Thread 3 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:38 PM: Thread 4 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:38 PM: Thread 5 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:38 PM: Thread 6 error:
    Process terminated unexpectedly. Error code: -2139684860 (An abort request is preventing anything except termination actions.)
    1/5/2013 10:00:38 PM:
    1/5/2013 10:00:39 PM: SQL error 3013: SQL error 3013: RESTORE DATABASE is terminating abnormally.
    1/5/2013 10:00:39 PM: SQL error 3101: SQL error 3101: Exclusive access could not be obtained because the database is in use.
  • JoshDBGuy,

    We have used SQLBackup for a number of years but don't use the DISCONNECT_EXISTING because it might take longer than 20 seconds to rollbackup any active transactions. We try an ALTER DATABASE xxxx SET SINGLE_USER with ROLLBACK IMMEDIATE and wait for this to finish. Most servers now run with multiple CPU's but rollback is single threaded. So if you try and rollback a transaction that has run for 5 minutes on say 4 CPU's in parallel it could take 20 minutes to rollback.

    My 2 cents

    Chris
    English DBA living in CANADA
  • Actually just had this problem happen. My alter database set single_user had not finished in over 6 minutes so I cancelled it and tried it again. I am not sure what was holding the database but it can take time under some circumstances.

    Chris
    English DBA living in CANADA
  • I'm guessing I might just have to accept this as a possible issue with restores?
  • I suggest you restore all settings,and use by default.
Sign In or Register to comment.