SQL Server Compressed Backup

Documentation

DB Plugin Reference

The DB plugin is used for executing BACKUP DATABASE, or RESTORE DATABASE commands. Many of the options for these commands can be set here.

Backup Options

Many of these options come straight from the BACKUP DATABASE command in SQL Server Books Online. You can get more detailed information about many of the options there.

Backup OptionRequiredDescription
databaseYesThe name of the database to backup
instancenameNoThe name server instance. This should not include the "\". If the server name to connect is ".\sqlexpress", then the instance name is just "sqlexpress".
clusternetworknameNo *The name of the cluster network name shared by the two nodes in a SQL Server cluster. Keep in mind that this program will only work on the active node.
* Although this option is not normally required, this option is required in clustered environments.
New in version 1.1.
backuptypeNoThe choices are
  • full
  • differential
  • log
COPY_ONLYNoSQL Server Books Online has more information.
CHECKSUMNoSQL Server Books Online has more information.
NO_CHECKSUMNoSQL Server Books Online has more information.
STOP_ON_ERRORNoSQL Server Books Online has more information.
CONTINUE_AFTER_ERRORNoSQL Server Books Online has more information.
READ_WRITE_FILEGROUPSNoAdvanced option. On the command line, do not use the "=" in the configuration. For example, "db(database=model;READ_WRITE_FILEGROUPS;backuptype=full)" is how to use the option. SQL Server Books Online has more information.
FILENoAdvanced option. This option can be used multiple times to list multiple files. SQL Server Books Online has more information.
FILEGROUPNoAdvanced option. This option can be used multiple times to list multiple filegroups. SQL Server Books Online has more information.
BUFFERCOUNTNoThe number of buffers that SQL Server will create for backing up. It is possible for SQL Server to run out of memory if this is too high. space used = buffer count * max transfer size
MAXTRANSFERSIZENoThe largest unit of transfer in bytes. Valid values are between 65536 and 4194304.

Backup Example

The example below does a log backup of the primary filegroup with the CHECKSUM option.

msbp.exe backup "db(database=model;instancename=sqlexpress;backuptype=log;filegroup=primary;checksum)" "local(path=c:\model.bak)"

Restore Options

Many of these options come straight from the RESTORE DATABASE command in SQL Server Books Online. You can get more detailed information about many of the options there.

Backup OptionRequiredDescription
databaseYesThe name of the database to restore
instancenameNoThe name server instance. This should not include the "\". If the server name to connect is ".\sqlexpress", then the instance name is just "sqlexpress".
clusternetworknameNo *The name of the cluster network name shared by the two nodes in a SQL Server cluster. Keep in mind that this program will only work on the active node.
* Although this option is not normally required, this option is required in clustered environments.
New in version 1.1.
restoretypeNoThe choices are
  • database
  • log
MOVENoThis is used to restore a file in the database to another location. This can be used multiple times to enter multiple filegroups. The format is MOVE='<logical file or filegroup>'TO'<filesystem path>. An example is: db(database=model; MOVE='modeldev'TO'c:\model.mdf'; MOVE='modellog'TO'c:\model.ldf';)
CHECKSUMNoSQL Server Books Online has more information.
NO_CHECKSUMNoSQL Server Books Online has more information.
STOP_ON_ERRORNoSQL Server Books Online has more information.
CONTINUE_AFTER_ERRORNoSQL Server Books Online has more information.
KEEP_REPLICATIONNoSQL Server Books Online has more information.
ENABLE_BROKERNoSQL Server Books Online has more information.
ERROR_BROKER_CONVERSATIONSNoSQL Server Books Online has more information.
NEW_BROKERNoSQL Server Books Online has more information.
RECOVERYNoSQL Server Books Online has more information.
NORECOVERYNoSQL Server Books Online has more information.
STANDBYNoEnter the path to the standby file on the right side of the equals sign in the configuration. SQL Server Books Online has more information.
REPLACENoSQL Server Books Online has more information.
RESTARTNoSQL Server Books Online has more information.
RESTRICTED_USERNoSQL Server Books Online has more information.
STOPATNoEnter the date and time on the right side of the equals sign. SQL Server Books Online has more information.
PARTIALNoAdvanced option. SQL Server Books Online has more information.
READ_WRITE_FILEGROUPSNoAdvanced option. SQL Server Books Online has more information.
FILENoAdvanced option. SQL Server Books Online has more information.
FILEGROUPNoAdvanced option. SQL Server Books Online has more information.
LOADHISTORYNoSQL Server Books Online has more information.
BUFFERCOUNTNoThe number of buffers that SQL Server will create for restoring. It is possible for SQL Server to run out of memory if this is too high. space used = buffer count * max transfer size
MAXTRANSFERSIZENoThe largest unit of transfer in bytes. Valid values are between 65536 and 4194304.

Restore Example

The example below does a database restore of the primary filegroup with the CHECKSUM option, moving the mdf and ldf files to a different location.

msbp.exe restore "local(path=c:\model.bak)" "db(database=model;instancename=sqlexpress;filegroup=primary;checksum;MOVE='modeldev'TO'c:\model.mdf';MOVE='modellog'TO'c:\model.ldf';)"