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 Option | Required | Description |
database | Yes | The name of the database to backup |
instancename | No | The name server instance. This should not include the "\".
If the server name to connect is ".\sqlexpress", then the instance name is just
"sqlexpress". |
clusternetworkname | No * | 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.
|
backuptype | No | The choices are
|
COPY_ONLY | No | SQL Server Books Online has more information. |
CHECKSUM | No | SQL Server Books Online has more information. |
NO_CHECKSUM | No | SQL Server Books Online has more information. |
STOP_ON_ERROR | No | SQL Server Books Online has more information. |
CONTINUE_AFTER_ERROR | No | SQL Server Books Online has more information. |
READ_WRITE_FILEGROUPS | No | Advanced 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. |
FILE | No | Advanced option. This option can be used
multiple times to list multiple files. SQL Server Books Online has more information. |
FILEGROUP | No | Advanced option. This option can be
used multiple times to list multiple filegroups. SQL Server Books Online has more information. |
BUFFERCOUNT | No | The 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 |
MAXTRANSFERSIZE | No | The 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 Option | Required | Description |
database | Yes | The name of the database to restore |
instancename | No | The name server instance. This should not include the "\".
If the server name to connect is ".\sqlexpress", then the instance name is just
"sqlexpress". |
clusternetworkname | No * | 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.
|
restoretype | No | The choices are
|
MOVE | No | This 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';) |
CHECKSUM | No | SQL Server Books Online has more information. |
NO_CHECKSUM | No | SQL Server Books Online has more information. |
STOP_ON_ERROR | No | SQL Server Books Online has more information. |
CONTINUE_AFTER_ERROR | No | SQL Server Books Online has more information. |
KEEP_REPLICATION | No | SQL Server Books Online has more information. |
ENABLE_BROKER | No | SQL Server Books Online has more information. |
ERROR_BROKER_CONVERSATIONS | No | SQL Server Books Online has more information. |
NEW_BROKER | No | SQL Server Books Online has more information. |
RECOVERY | No | SQL Server Books Online has more information. |
NORECOVERY | No | SQL Server Books Online has more information. |
STANDBY | No | Enter the path to the standby file on the right side
of the equals sign in the configuration.
SQL Server Books Online has more information. |
REPLACE | No | SQL Server Books Online has more information. |
RESTART | No | SQL Server Books Online has more information. |
RESTRICTED_USER | No | SQL Server Books Online has more information. |
STOPAT | No | Enter the date and time on the right side of the equals sign.
SQL Server Books Online has more information. |
PARTIAL | No | Advanced option. SQL Server Books Online has more information. |
READ_WRITE_FILEGROUPS | No | Advanced option. SQL Server Books Online has more information. |
FILE | No | Advanced option. SQL Server Books Online has more information. |
FILEGROUP | No | Advanced option. SQL Server Books Online has more information. |
LOADHISTORY | No | SQL Server Books Online has more information. |
BUFFERCOUNT | No | The 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 |
MAXTRANSFERSIZE | No | The 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';)"
|