Quantcast
Channel: Red Gate forums: SQL Backup 7
Viewing all articles
Browse latest Browse all 713

RE: Delay between backups on SQL Backup Pro

$
0
0
If it helps, the most common cause of the delay is when you:

    - backup a lot of databases using the BACKUP DATABASES syntax
    - to the same folder
    - and use the ERASEFILES option to delete older backup files

In these situations, there will be a lot of files in that single folder, and after every database backup, SQL Backup will scan every single file in that folder to determine which file it needs to delete. This issue will be compounded if you back up to a network share, as the scanning process will take even longer.

What you can do is to place each database's backup files in its own separate folder using the <DATABASE> tag e.g. instead of

Code:
EXEC master..sqlbackup '-sql "BACKUP DATABASES [*] TO DISK = [\\netshare\backups\<AUTO>]... " '

use
Code:
EXEC master..sqlbackup '-sql "BACKUP DATABASES [*] TO DISK = [\\netshare\backups\<DATABASE>\<AUTO>]... " '

Now, SQL Backup needs to scan only that specific database's folder to determine which file(s) to delete, which speeds things up significantly. If that is still too slow, you can add another subfolder based on the backup type using the <TYPE> tag e.g.

Code:
EXEC master..sqlbackup '-sql "BACKUP DATABASES [*] TO DISK = [\\netshare\backups\<DATABASE>\<TYPE>\<AUTO>]... " '

Viewing all articles
Browse latest Browse all 713

Trending Articles