Veritas NetBackup™ for Microsoft SQL Server Administrator's Guide
- Introducing NetBackup for SQL Server
- Installing NetBackup for SQL Server
- Instance Management for SQL Server Intelligent Policies
- Viewing the SQL Server instances and instance groups in instance management
- About registering SQL Server instances
- Configuring SQL Server backups with SQL Server Intelligent Policy
- Configuring NetBackup for SQL Server
- Performing restores of SQL Server
- Redirecting a SQL Server database to a different host
- Restoring multistreamed SQL Server backups
- Protecting SQL Server data with VMware backups
- About protecting SQL Server data with VMware backups
- Using NetBackup for SQL Server with Snapshot Client
- Using copy-only snapshot backups to affect how differentials are based
- About SQL Server agent grouped backups (legacy SQL Server policies)
- Protecting SQL Server in high availability (HA) environments
- About using NetBackup to protect SQL Server availability groups
- About protecting the preferred replica in a SQL Server availability group (legacy backup policies)
- About protecting a specific node in a SQL Server availability group
- About NetBackup for SQL Server with database mirroring
- Backup and recovery concepts
- Overview of SQL Server backup and recovery concepts
- About recovery factors for SQL Server
- Using NetBackup for SQL Server with multiple NICs
- Configuring backups with legacy SQL Server policies using clients and batch files
- About using batch files with NetBackup for SQL Server
- About schedule properties
- Backing up read-only filegroups
- Performing user-directed operations with dbbackex
- Using bplist to retrieve a list of SQL Server backups
- SQL Server backups and restores in an SAP environment (legacy SQL Server policies)
- About SQL Server backups and restores in an SAP environment
- Troubleshooting
- About debug logging for SQL Server troubleshooting
- Disaster recovery of a SQL Server
- Appendix A. Sample batch files
- About sample backup batch files for legacy SQL Server policies
- About sample restore batch files
- About sample backup batch files for legacy SQL Server policies
- Appendix B. Multiplexed backups
- Appendix C. Register authorized locations
Script that uses environment variables to exclude instances and databases from backup
You can use SQLINSTANCE $ALL in your batch file to designate that all SQL Server instances on your host be backed up. For example, the following batch file backs up the master, model, and msdb databases. These databases are backed up on all instances of SQL Server on the host on which the batch file is run.
SQLINSTANCE $ALL OPERATION BACKUP DATABASE "master" NBSERVER "BEARING" MAXTRANSFERSIZE 6 BLOCKSIZE 7 NUMBUFS 2 ENDOPER TRUE OPERATION BACKUP DATABASE "msdb" NBSERVER "BEARING" MAXTRANSFERSIZE 6 BLOCKSIZE 7 NUMBUFS 2 ENDOPER TRUE OPERATION BACKUP DATABASE "model" NBSERVER "BEARING" MAXTRANSFERSIZE 6 BLOCKSIZE 7 NUMBUFS 2 ENDOPER TRUE
To exclude SQL Server instances on your host from backup, create the Windows environmental variable NB_SQL_INSTANCE_EXCLUDE. Specify a list of instances names that you want to exclude. The list should consist of one or more names that are separated by semi-colons.
For example, use the following value to indicate that you want to exclude the default SQL Server instance and the instance named ABC-PRODUCTS from backup:
#DEFAULT#;ABC-PRODUCTS;
Note that the default SQL Server instance for the local host is designated as #default#.
You can also exclude individual databases from backup by creating a Windows environmental variable NB_SQL_DATABASE_EXCLUDE. For the value of the variable, specify a list of database names.
For example, consider the following batch file:
SQLINSTANCE $ALL OPERATION BACKUP DATABASE $ALL NBSERVER "BEARING" MAXTRANSFERSIZE 6 BLOCKSIZE 7 NUMBUFS 2 ENDOPER TRUE
You can exclude the databases "master," "accounting," and "pubs" with the NB_SQL_DATABASE_EXCLUDE environmental variable. For the value of the variable, indicate the databases you want to exclude. Separate the database names with semi-colons.
MASTER;ACCOUNTING;PUBS
The NB_SQL_DATABASE_EXCLUDE variable is applicable only for a batch file that has DATABASE $ALL. It performs the same function as the keyword and value pair EXCLUDE <database>. If both variables are used, they augment each other to determine which databases to exclude.