Ransomware attackers specifically target and attempt to destroy backup systems to increase the probability of payment. Hardening your system is critical. Please ensure you have reviewed your platform security using the Security Hardening Checklist
Cohesity

COHESITY Documentation

Explore our documentation to get started, discover products & new features, access troubleshooting guides, register sources, platforms support.

Products
Data Security Alliance
Visit Cohesity.com
Demos
Support
Blogs
Developers
Partner Portals
Cohesity Community
© 2026 Cohesity, Inc. All Rights Reserved.
Terms of Use|
Privacy Policy|
Legal|
  1. Home
  2. NetBackup™ for Microsoft SQL Server Administrator's Guide
  3. Configuring batch-file based policies for SQL Server backups
  4. Requirements to use batch files with NetBackup for SQL Server
NetBackup™ for Microsoft SQL Server Administrator's Guide

Requirements to use batch files with NetBackup for SQL Server

NetBackup for SQL Server uses batch files to initiate backup and restore operations. A batch file uses the .bch extension and is typically run from the install_path\DbExt\MsSql\ directory. If you use a SQL Server intelligent policy or a protection plan for backups, the batch files are created automatically. Batch files are automatically created for restores that you perform with the NetBackup web UI.

You must create a batch file if you start operations in any of the following ways:

  • NetBackup MS SQL Client

  • dbbackex command line

  • Automatically scheduled backups from policies that use batch files and clients

Rules for using batch files

Review the following information before you create and use batch files:

  • Ensure that the batch file resides on the client.

    See Registering authorized locations used by a NetBackup database script-based policy.

  • Batch files are in Unicode text.

  • A batch file consists of a series of operations that run in sequence. For batch file-based policies, you create batch files for backup operations and restore operations. For SQL Server Intelligent Policy, you create the batch files for restore operations in the same way.

  • Each operation consists of a series of <keyword value> pairs, which completely define the total operation.

  • The keyword is not case-sensitive but the value is. Generally, you can code both the keyword and value in uppercase. The exception is the NBIMAGE keyword option. The value must be specified exactly as it appears in the NetBackup server.

  • Operations are not nested.

  • With the exception of the BATCHSIZE, GROUPSIZE, RESTARTTYPE, NUMRESTARTS, and RESTARTWAITSECONDS parameters, <keyword value> pairs are not global. If you use BATCHSIZE, GROUPSIZE, RESTARTTYPE, NUMRESTARTS, or RESTARTWAITSECONDS then it must appear only once in your batch file and it must appear in the first operation.

  • If SQLINSTANCE $ALL is used, then it must appear in the first operation of the batch file. Each operation in the batch file is performed for all SQL Server instances on the client where the batch file is run. Also, it is not necessary to specify an SQLHOST or SQLINSTANCE on any subsequent operations.

  • Within an operation, the <keyword value> pairs may appear in any order except that you must terminate each operation with ENDOPER TRUE.

  • You can include comment lines in your batch file by placing a hash mark ('#') in the first column.

  • STOPAT, RESTORETOMARK, RESTORETOMARKAFTERTIME, RESTOREBEFOREMARK, and RESTOREBEFOREMARKAFTERTIME are mutually exclusive restore parameters. If either RESTORETOMARKAFTERTIME or RESTOREBEFOREMARKAFTERTIME are used, then the batch file must also specify a datetime string with the keyword STOPAFTER.

  • If you remove the MAXTRANSFERSIZE keyword from the batch file, the default is 0 or a maximum transfer size of 64 KB. If you remove the BLOCKSIZE keyword from the batch file, the default is 0 or a block size of .5 KB. A default value of 0 is also applied if you manually create a batch file without these keywords.

Feedback

Was this page helpful?
Previous

About SQL Server security with batch file-based policies

Next

Keywords and values used in batch files

Feedback

Was this page helpful?