SQL Backup - 7.1
Backing up all databases on an instance - SQL Backup
You may want to back up all the databases on an instance, or all but one or two. Both the backup wizards and the BACKUP command syntax include options to back up all databases on an instance and exclude particular databases.
Using the backup wizards
To take a single backup, open the Back Up wizard. To create a scheduled backup job, open the Schedule Backup Jobs wizard.
On step 1 of the wizard, select the SQL Server instance.
On step 2 of the wizard, select the type of backup (full, differential or transaction log), then select the databases you want to back up. To back up all databases, or all system or user databases, keep the default option of Include these and then select All, System or User as appropriate. The selected databases are marked with ![]()

If you select differential backups, only databases that have previously had a full backup taken are available:

If you select transaction log backups, only databases that are in full or bulk-logged recovery mode and have previously had a full backup taken are available:

To back up all databases on the instance except for specified databases, select Exclude these from the drop-down list. Then select the databases that you do not want to back up. The excluded databases are marked with
All other databases that are online and operational when the job runs will be backed up.

Proceed through the rest of the wizard as normal. On the final step of the wizard you can view a summary of the options you have selected, including the databases you have included or excluded.

Note that if you have included all databases or have selected Exclude these, any databases which you subsequently add to the instance will also be included in the backup job the next time it runs. This is because the backup command generated by the wizard uses the wildcard character * to select all databases on the instance.
If you add a database to an instance and do not want to include it in the job, you will need to edit the job to exclude the database. From the Jobs tab, couble-click the job to open the Edit Backup Job wizard.
If you have created a differential or transaction log backup job and later add a database to the instance that you do not exclude from the job, you should take a full backup of that database. If a full backup does not exist, the differential or transaction log backup for that database may fail with SQL Backup VDI error 1010 and SQL error 3059 (differential backups) or 4214 (transaction log backups), depending on the version of SQL Server you are using. This is because a full backup is required to restore a differential or transaction log backup. Refer to your SQL Server documentation for more information.
Alternatively, you can add the SQL Backup keyword FULLIFREQUIRED to the command to ensure that a full backup of the database is taken before a differential or transaction log backup is attempted. You can add the keyword by editing the extended stored procedure or command line instruction (this option cannot be added from the backup wizards). This keyword is explained in more detail below and in The BACKUP command.
Using the BACKUP DATABASES command with the extended stored procedure or command line
In the following examples, the extended stored procedure version of the command is given first (beginning EXECUTE master..sqlbackupC) followed by the command line version (beginning SQLBackupC.exe). For more information, see Using the extended stored procedure and Using the command line.
To back up all databases on the instance you are connected to, use ALL or a single wildcard character (*). For example:
EXECUTE master..sqlbackup '-SQL "BACKUP ALL DATABASES TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP ALL DATABASES TO DISK = 'C:\Backups\<AUTO>'"
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASES [*] TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP DATABASES [*] TO DISK = 'C:\Backups\<AUTO>'"
To back up all system databases (master, model and msdb) on the instance you are connected to, use SYSTEM. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP SYSTEM DATABASES TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP SYSTEM DATABASES TO DISK = 'C:\Backups\<AUTO>'"
To back up all online and operational user databases on the instance you are connected to, use USER. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP USER DATABASES TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP USER DATABASES TO DISK = 'C:\Backups\<AUTO>'"
To back up all online and operational databases (both system and user) on the instance you are connected to, apart from certain specified databases, use EXCLUDE. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP DATABASES EXCLUDE [master, model, Testing] TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP DATABASES EXCLUDE [master, model, Testing] TO DISK = 'C:\Backups\<AUTO>'"
You can combine SYSTEM or USER with EXCLUDE. For example, the following command backs up all online and operational user databases other than AdventureWorksDW and pubs:
EXECUTE master..sqlbackup '-SQL "BACKUP USER DATABASES EXCLUDE [AdventureWorksDW, pubs] TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP USER DATABASES EXCLUDE [AdventureWorksDW, pubs] TO DISK = 'C:\Backups\<AUTO>'"
Include WITH DIFFERENTIAL to take a differential backup of the specified databases. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP USER DATABASES EXCLUDE [SalesArchive] TO DISK = ''C:\Backups\<AUTO>'' WITH DIFFERENTIAL"'
SQLBackupC.exe -SQL "BACKUP USER DATABASES EXCLUDE [SalesArchive] TO DISK = 'C:\Backups\<AUTO>' WITH DIFFERENTIAL"
A full database backup is required to restore a differential backup. If a full backup is not taken before taking a differential backup, the differential backup may fail with SQL Backup error VDI 1010 and SQL error 3035. You may encounter this error if you set up a differential backup job using *, ALL, SYSTEM or USER and later add a database to the instance and do not take a full backup before the job runs.
To avoid this error, include WITH FULLIFREQUIRED to take a full backup of any databases that require one, before the differential backup is taken. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP USER DATABASES TO DISK = ''C:\Backups\<AUTO>'' WITH DIFFERENTIAL, FULLIFREQUIRED"'
SQLBackupC.exe -SQL "BACKUP USER DATABASES TO DISK = 'C:\Backups\<AUTO>' WITH DIFFERENTIAL, FULLIFREQUIRED"
Any additional options you include in the command, such as compression, encryption, verification and network resilience settings will also be applied to the full backup. However, INIT, FILEOPTIONS and the ERASEFILES options will not be applied to the full backup.
Note that FULLIFREQUIRED is not available when backing up databases on SQL Server 2005.
Using the BACKUP LOGS command with the extended stored procedure or command line
In the following examples, the extended stored procedure version of the command is given first (beginning EXECUTE master..sqlbackupC) followed by the command line version (beginning SQLBackupC.exe). For more information, see Using the extended stored procedure and Using the command line.
To back up transaction logs of all online and operational databases using the FULL or BULK-LOGGED recovery model on the instance you are connected to, use a single wildcard character. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP LOGS [*] TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP LOGS [*] TO DISK = 'C:\Backups\<AUTO>'"
To back up the transaction logs of all online and operational databases using the FULL or BULK-LOGGED recovery model on the instance you are connected to, apart from certain specified databases, use EXCLUDE. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP LOGS EXCLUDE [SalesArchive] TO DISK = ''C:\Backups\<AUTO>''"'
SQLBackupC.exe -SQL "BACKUP LOGS EXCLUDE [SalesArchive] TO DISK = 'C:\Backups\<AUTO>'"
A full database backup is required to restore transaction log backups. If a full backup has not been taken before taking transaction log backups, the backups may fail with SQL Backup error VDI 1010 and SQL error 4214. You may encounter this error if you set up a transaction log backup job using BACKUP LOGS [*] or BACKUP LOGS EXCLUDE [<database name>], later add a database to the instance or change a database's recovery model from simple to full or bulk-logged, and do not take a full backup before the job runs.
To avoid this error, include WITH FULLIFREQUIRED to take a full backup of any databases that require one, before the transaction log backup is taken. For example:
EXECUTE master..sqlbackup '-SQL "BACKUP LOGS [*] TO DISK = ''C:\Backups\<AUTO>'' WITH FULLIFREQUIRED"'
SQLBackupC.exe -SQL "BACKUP LOGS [*] TO DISK = 'C:\Backups\<AUTO>' WITH FULLIFREQUIRED"
Any additional options you include in the command, such as compression, encryption, verification and network resilience settings will also be applied to the full backup. However, INIT, FILEOPTIONS and the ERASEFILES options will not be applied to the full backup.
Note that FULLIFREQUIRED is only available with SQL Server 2008 and later.
Was this article helpful?
SQL Backup
- Backups stop working when the SQL account passwords are changed
- Backups and restores taking longer each time they run
- Improving performance by leveraging multi-processor hardware
- Checking the status of a backup or restore
- SQL Backup Agent doesn't start on named instance
- No backup files are erased when the verify option is also used
- Log shipping initialisation failing with error 3176
- Installing SQL Backup unattended
- Issues faced when upgrading an MSCS cluster server
- Cannot schedule log shipping on case-sensitive servers
- Activation fails because response does not match registration properties
- SQL error -1 on backup with 64-bit
- Could not find procedure 'master...sqbutility'
- 'Does not exist' error manually creating a generic service resource
- Backing up log shipping standby databases
- Stopping a backup or restore whilst in progress
- Backing up full-text catalogs using SQL Backup
- Cannot resolve collation conflict
- Microsoft cluster installation (version 4)
- Informing the SQL Agent of job failures
- Database log files may continue to grow even though transaction logs are backed up
- Cannot load xp_sqlbackup.dll
- Minimum Windows Rights Required for SQL Backup Agent
- Bringing a log shipping standby database online
- Console does not support editing the command you selected
- Malformed database disk image error
- Cannot use a local account to run SQL Backup Agent on cluster
- Preparing SQL Servers for remote installation
- SQL error 18210 and VDI error 1010
- Log shipping jobs not deleting old .sqb files
- Scheduled backups may not include new databases
- VDI error 1010 due to an abort request
- Cannot save or see backup templates
- Not all databases appear in the log shipping wizard
- No mapping between account names and security IDs was done
- SQL error 3101 (database is in use) during log shipping
- Insufficient quota to complete the requested service
- Configuring SQL Server procedure memory
- Backing up and restoring on SQL Server Express Edition
- Cannot run two database backups at the same time
- Restoring database backups across a local network
- In some situations the last compressed data block fails to be written to disk
- Configuring permissions for the SQL Backup Agent service
- Restoring backups from one server to a second server using the user interface
- Using SQL Backup tags to automate backup file naming
- VDI 1010 Error
- SQL Backup 5 cannot connect to servers running SQL Backup 4.0
- Files are created when NOWRITE or NOCOMPRESSWRITE is used in conjunction with multiple threads
- Cannot backup a database when full-text catalogs are not online
- Moving a full-text catalog on RESTORE
- Preventing backups over the network from timing out
- Deleting backup history manually
- SQL Backup installation from SQL Toolbelt installer only installs the console
- Console taking a long time to start up
- Reporting across multiple servers, login fails for user NT AUTHORITY\ANONYMOUS LOGON
- SQL Backup Agent cannot start due to account lookup error
- IO Error on backup or restore restart-checkpoint file
- Unable to edit SQL Backup Scheduled Jobs via the Jobs Tab in the SQL Backup GUI (version 5)
- VDI error 1000 caused by improperly installed VDI interface
- VDI Error 1000 caused by account lookup failure
- VDI error 1000 caused by insufficient permissions
- Error 193: %1 is not a valid Win32 application.
- Installing SQL Backup on a cluster
- Restoring the SQL Server MASTER database
- VDI Error 1010: Failed to get the configuration from the server because the timeout interval has elapsed
- Changing the default data location used by SQL Backup
- Index was outside the bounds of the array error during registration
- Repairing the SQL Backup server-side data store
- Troubleshooting slow backup and restore tasks
- Completed backup jobs showing "in progress" status (version 5)
- Restore wizard: files incorrectly labeled 'Missing' when browsing for a backup file to restore.
- When creating a backup job using the wizards some of the user databases may not be listed
- How to restore a filegroup
- System error 1453 while backing up (Insufficient quota to complete the requested service)
- SQL Backup VDI 1030: Failed to create VirtualServiceSet component
- Backups fail on named instances on custom ports
- SQL error 3101 (database is in use) during full database restore
- Error acquiring mutex occurring during use
- Transaction log continually growing on disaster recovery database
- Reseeding a disaster recovery database
- SMTP mail options not being saved
- SQL Backup Activation NullReferenceException Error
- Scheduling SQL Backup restore jobs
- SQL Backup Error 880: permission denied in database
- Deleting remote backup files after a specified time period (version 5)
- SQL Backup Unable to Login to Perform Backup or Restore
- Restore operation errors with exitcode 680
- "Failed to initialize local data store" error
- Trouble browsing network shares when backing up or restoring
- System error 32 (The process cannot access the file because it is being used by another process)
- Log backup failing because there is no current database backup
- Error locating server or instance of SQL Server
- How to set up log shipping between machines on different domains
- SQL Backup and CPU affinity
- SQL Backup mirrored backups
- Error trying to run backup job
- "Access to the database file is not allowed" error
- The server principal NT AUTHORITY\SYSTEM is not able to access the database
- Browsing while using SQL Server authentication is disabled on the selected server
- Cannot generate SSPI context message
- Log ship to multiple servers
- File browser does not work for remote servers
- Configuring Log Shipping to two Target Databases
- Previous backups not deleted according to ERASEFILES setting
- SQL Backup Reporting fails after upgrading to Version 6 from Version 5 for Multiple
- VDI error 1010 error on log backup when no backup is available
- SQL Backup failed with exit code: 1010 SQL error code: 3101 [SQLSTATE 42000] (Error 50000). The step failed.
- Log backup for a database failing to get copied to the log shipping share
- Mirrorfile backup jobs producing corrupt files
- Activity monitor showing sqlbackup status as wait type MSQL_XP
- Backup and restore processes using high percentage of CPU resources
- Warning 485: File does not exist encountered during a restore (but the process completes successfully)
- Log Shipping error 130 when moving restored file
- SQL Backup "Warning 110" generated
- Attempting to restore data into a SQL Express database that exceeds limit
- SQL error 3241 when restoring database
- A nonrecoverable I/O error encountered on Backup or restore operation
- SQL error 15404
- General log-in problem: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
- Warning: System error 1450 when Backing up
- Problems with "Auto-Close" option set when backing up
- Warning: System error 64 (The specified network name is no longer available) on backing up across a network
- SQL error 4208 encountered on backing up
- Warning 170: "Log files are not in sequence" - on log shipping (restore) operation
- Warning: System error 121 (The semaphore timeout period has expired)
- Changing your participation in the quality improvement program
- Installing SQL Backup server components unattended
- Changing your participation in the quality improvement program
- Verifying backups of the master database
- Log files
all SQL products
- Compatibility of Red Gate tools in 64-bit environments
- Application has encountered an error and needs to close
- Error message after installing SQL Toolbelt - The description for Event ID ( 1 ) in Source ( nview_info ) cannot be found.
- Changing the temporary directory used by the installer
- Toolbelt Installer "hanging" while "scanning volumes"
- Login failing with "trusted SQL Server connection" error when using RunAs
all products
- Some Red Gate products identified as containing a trojan by Anti-Virus software
- Activation may fail with Unknown Error -1
- Product uses web help although a CHM file is available locally
- Argument exception resulting from missing environment variable
- Check for updates may fail when used through proxies
- 'Unidentified Publisher' error when repairing or uninstalling
- Licensing activates product as standard edition
- Moving Red Gate software products to another machine
- Red Gate tools log locations
- The application UI opening slowly when there is no internet access
SQL Backup
- Getting help offline
- Using SQL Backup to back up to a network share
- Manually installing SQL Backup server components on clusters (Windows Server 2003)
- Manually installing SQL Backup server components on clusters (Windows Server 2008)
- Using SQL Backup log shipping to maintain a standby server
- SQL Backup release notes - version 6.xx
- SQL Backup release notes - version 7.xx
- Working with the new features in SQL Backup 6
- Using flexible licensing with SQL Backup Pro and SQL HyperBac
- Using SQL Backup Pro and SQL HyperBac together on the same server
all SQL products
all products
- Red Gate product acknowledgements
- Activating your products
- Activating your products
- Red Gate bundle history
- Check for updates
- Troubleshooting Check for Updates errors
- Current versions
- Deactivating your products
- Installing Red Gate products from the .msi file
- Requesting additional activations
- Serial numbers for bundles
- Reactivating using a different serial number
- Extending your trial
- Finding your serial numbers
- Moving a serial number from one computer to another
- No response received for manual activation
- Licensing and activation resources
- Licensing and activation resources
- Troubleshooting licensing and activation errors
- Licensing and activation FAQs
- Red Gate tools log file locations
- Download old versions of products
- Download product prerequisites & utilities
- Support & upgrades
- Upgrading your software
- Upgrading FAQs

Installing or upgrading SQL Backup