How To Use NFCMD to Disable/Enable Replication Filters for Avoiding MaxDiskUsage Errors

How To Use NFCMD to Disable/Enable Replication Filters for Avoiding MaxDiskUsage Errors

Summary

This Knowledgebase article describes how to use nfcmd to disable/enable filters in order to avoid MaxDiskUsage errors during SQL Server backup/indexing jobs.

More information

SQL Server backup/indexing jobs generate a considerable amount of data which must be transmitted from the active server to the passive server. Much of the writes to some database files during the re-indexing contain temporary data which may not necessarily be retained once the indexing has completed. With the passive server applying data at a much slower rate than the active server generates it, MaxDiskUsage errors may appear on the passive server. Please see Knowledgebase article #2056 for more details about MaxDiskUsage errors.

In such scenarios, Neverfail recommends implementing scheduled tasks which trigger nfcmd commands to disable the affected databases from the protected set before the backup/indexing jobs are started and then re-enable the databases back once the backup/indexing jobs have finished.

Note: When using this procedure, databases that have been temporarily disabled will not be protected in case of a failover.

Procedure

  1. To disable/enable file-pattern filters, create a .bat file consisting of the following commands:
a. To disable a "filter-pattern" filter:
C:\Program Files\Neverfail\r2\bin\nfcmd localhost AMFramework.SetFileInclusionFilterEnabled "filter-pattern" false
Where the "filter-pattern" is replaced with the actual filter-pattern, for example:
C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL10.MSSQLSERVER\MSSQL\DATA\REPORTSERVERTEMPDB_LOG.LDF

b.  To enable a "filter-pattern" filter: C:\Program Files\Neverfail\r2\bin\nfcmd localhost AMFramework.SetFileInclusionFilterEnabled "filter-pattern" true Where the "filter-pattern" is replaced with the actual filter-pattern: C:\PROGRAM FILES\MICROSOFT SQL SERVER\MSSQL10.MSSQLSERVER\MSSQL\DATA\REPORTSERVERTEMPDB_LOG.MDF

IMPORTANT: Enabling/disabling a file filter works only for filters which are not a Subset (Contained within another filter) . For instance if you have a higher filter such as: C:\Program Files\Microsoft SQL Server\Data** and another filter C:\Program Files\Microsoft SQL Server\Data\Custom\Database.mdf. Disabling the last filter won’t help because the first filter will tell Neverfail to replicate all the data within the higher filter. 2.  Create a new task using the Task Scheduler and for the Action Run Program/Script select the .bat file to disable the filters right before the backup/indexing job is started. 3.  Create an additional task using the Task Scheduler and for the Action Run Program/Script select the .bat file to re-enable the filters after the backup/indexing job is         finished.


Applies To

Neverfail Engine


Related Information

None

KBID-2442