Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backup fails using smo on big databases

I use vb.net to backup sql '05 - '08 databases. It works great on smaller databases. but when it comes to large databases it fails at 30 or 40 percent with the error: The backup or restore was aborted.

        Dim objBackup1 As Backup = New Backup() With {.Action = BackupActionType.Database, .Database = Common.DsSettings("DataBase", Nothing), .Initialize = True, .Checksum = True, .ContinueAfterError = True, .Incremental = False, .LogTruncation = BackupTruncateLogType.Truncate}

    objBackup1.SqlBackup(objServer)

Any idea on how to overcome this problem?

like image 503
Ezi Avatar asked May 18 '11 18:05

Ezi


2 Answers

Can't remember exactly, but I think it might be that the operation is timing out. I think the default timeout is 10 minutes, but if you set it to 0 it'll disable the timeout.

Something like:

conn.StatementTimeout = 0
like image 188
Hans Olsson Avatar answered Sep 25 '22 13:09

Hans Olsson


Have a look at this, looks like a timeout issue:

http://devio.wordpress.com/2009/03/27/handling-smo-sqlbackup-timeout/

and

http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.common.serverconnection.statementtimeout.aspx?ppud=4

like image 42
Tom Pickles Avatar answered Sep 23 '22 13:09

Tom Pickles