How can we help you today? How can we help you today?

master..sqlbackup takes 5 minutes to fail if files missing!

I'm running the following command, which is one of a whole batch of commands generated by a migration script:
EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [mydb] FROM DISK = ''Y:SQL-BACKUPDataFULL_(local)_mydb_*.sqb'' WITH REPLACE, PASSWORD = ''*****'', RECOVERY,  MOVE ''mydb'' TO ''E:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDatamydb.MDF'',  MOVE ''mydb_log'' TO ''E:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDatamydb_log.LDF''"'

In this case, there's no backup file - Y:SQL-BACKUPDataFULL_(local)_mydb_*.sqb doesn't exist.

The problem is - the job takes five minutes to fail, which makes it quite time-consuming to debug restore batches! Is there some way I can specify a more aggressive timeout? I'm restoring files from local SSD storage so not concerned about network latency or anything.

Thanks,

-D-
dylanbeattie
0

Comments

2 comments

  • KelvinSmith
    Did you try performing a Native Full and Differential backup?
    KelvinSmith
    0
  • petey
    By default, SQL Backup makes 10 attempts in intervals of 30 seconds to locate the file. You can adjust these two values by using the DISKRETRYCOUNT and DISKRETRYINTERVAL options. To turn this off, use a DISKRETRYCOUNT value of 0 e.g.
    EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [mydb] FROM DISK = ''Y:SQL-BACKUPDataFULL_(local)_mydb_*.sqb'' WITH REPLACE, PASSWORD = ''*****'', RECOVERY,  MOVE ''mydb'' TO ''E:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDatamydb.MDF'',  MOVE ''mydb_log'' TO ''E:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDatamydb_log.LDF'', DISKRETRYCOUNT = 0"'
    
    petey
    0

Add comment

Please sign in to leave a comment.