30.06.2013 Views

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8: Database <strong>Backup</strong> <strong>and</strong> <strong>Restore</strong> with <strong>SQL</strong> <strong>Backup</strong> Pro<br />

The first thing to notice is that the backup is executed via an extended stored procedure<br />

called sqlbackup, which resides in the master database <strong>and</strong> utilizes some compiled<br />

DLLs that have been installed on the server. We pass to this stored procedure a set of<br />

parameters as a single string, which provides the configuration settings that we wish to<br />

use for the backup operation. Some of the names of these settings are slightly different<br />

from what we saw for native backups but, nevertheless, the script should look fairly<br />

familiar. We see the usual BACKUP DATABASE comm<strong>and</strong> to signify that we are about to<br />

backup the DatabaseFor<strong>SQL</strong><strong>Backup</strong>s database. We also see the TO DISK portion <strong>and</strong><br />

the path to where the backup file will be stored.<br />

The latter portion of the script sets values for some of the optimization settings that we<br />

saw on Step 4 of the GUI wizard. These are not necessary for taking the backup, but it's<br />

useful to know what they do.<br />

• DISKRETRYINTERVAL – One of the network resiliency options; amount of time<br />

in seconds <strong>SQL</strong> <strong>Backup</strong> will wait before retrying the backup operation, in the case<br />

of a failure.<br />

• DISKRETRYCOUNT – Another network resiliency option; number of times a backup<br />

will be attempted in the event of a failure. Bear in mind that the more times we retry,<br />

<strong>and</strong> the longer the retry interval, the more extended will be the backup operation.<br />

• THREADCOUNT – Using multiple processors <strong>and</strong> multiple threads can offer a huge<br />

performance boost when taking backups.<br />

The only setting that could make much of a difference is the threadcount parameter,<br />

since on powerful multi-processor machines it can spread the load of backup<br />

compression over multiple processors.<br />

Go ahead <strong>and</strong> run the script now <strong>and</strong> the output should look similar to that shown in<br />

Figure 8-8.<br />

254

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!