Create batch files for the policy that protects the preferred or the primary replica
This topic describes how to create batch files for the backup policies that protect the availability group. These batch files can use either the PREFERREDREPLICA PREFERRED or PREFERREDREPLICA PRIMARY to protect either the preferred or the primary replica.
To create the batch files for an availability group, you must log on to each replica separately. Then use the NetBackup MS SQL Client to create the batch files on each replica.
To create batch files for the policy that protects the preferred replica
- This procedure assumes that you already created a separate policy for each type of backup that you want to perform.
- Perform steps 3 to 14 in this procedure on each replica in the availability group.
You must log on to each replica separately and create the batch files from that replica. This way the batch files have the correct settings for each node. Backups may fail if you create a batch file on one replica and copy it to the other replicas in the availability group.
- Log on to one of the replicas in the availability group.
- Open the NetBackup MS SQL Client.
- Select File > Set SQL Server connection properties.
- From the Instance drop-down list, select the instance that hosts the availability group.
- Select File > Backup SQL Server objects.
- Select the objects you want to backup in one of the following ways:
Select one or more databases, filegroups, or files.
To back up all databases, including the system databases (DATABASE $ALL), select the instance. From the Back up group, select All.
- Select the Type of Backup and any other settings.
- In the NetBackup Policy field, enter the name of the MS-SQL-Server policy that you created.
- From the Backup script group, select Save.
- Select Backup and open the batch file.
- For each operation in the batch file configure one of the following options:
To protect the preferred replica, add the keyword PREFERREDREPLICA PREFERRED.
To protect the primary replica, add the keyword PREFERREDREPLICA PRIMARY.
- Save and close the batch file.
Note the location of the batch file. Save the batch file for each replica to the same file location. This way you only need to enter one file location for the batch file in the Backup Selections list.
- Repeat steps 7 to 14 for any other types of backups that you want to perform. For example, full, differential, or transaction log.
More information is available on how to create batch files.
See Requirements to use batch files with NetBackup for SQL Server.
- Repeat the steps in this procedure (steps 3 to 15) to create batch files for the other availability group replicas.
- When you have created batch files for all the replicas on which you want backups to occur, add the batch files to the policies that you created previously.
See Add the batch files to the policy that protects the preferred or the primary replica.