Enabling filters on a subscription or non-MDN node (enablefilter) v7
The enablefilter
command enables one or more filter rules on a single-master replication system subscription or on a multi-master replication system primary node other than the primary definition node.
Use the enablefilter
command when you want to apply a filter rule to a subscription or a non-MDN node, but the filter rule didn't yet exist or it wasn't included with the subscription or the non-MDN node when these components were created.
Synopsis
Enabling a filter rule applies it to the specified, target subscription or non-MDN node and thus filters the data during replication from the source table to the target table.
See Table filters for more information.
Before enabling a filter rule, define it in the source publication in one of several possible ways:
For SMR:
- The table filter was defined in the publication of the primary database when it was first created either by the
createpub
command (see Creating a publication) or by the Replication Server console (see Adding a publication). - The table filter was added to an existing publication using the
addfilter
command (see Adding table filters to a publication) or by the Replication Server console (see Updating the set of available table filters in a publication).
For MMR:
- The table filter was defined in the publication of the primary definition node when it was first created either by the
createpub
command (see Creating a publication) or by the Replication Server console (see Adding a publication). - The table filter was added to an existing publication using the
addfilter
command (see Adding table filters to a publication) or by the Replication Server console (see Updating the set of available table filters in a publication).
Enable the filter rule as follows:
For SMR: Use the enablefilter
command or the Replication Server console (see Enabling and disabling table filters on a subscription).
For MMR: Use the enablefilter
command or the Replication Server console (see Enabling and disabling table filters on a primary node.
After you enable a filter rule, it filters the data during replication from the source table to the target table. You can disable a filter rule so that it no longer filters the data during replication to the target table (see Disabling filters on a subscription or non-MDN node).
Parameters
pubsvrfile
The file containing the publication server login information.
subname
For SMR only: The name of the subscription containing the tables on which to enable the filter rules.
dbid
For MMR only: The publication database ID of the non-MDN node containing the tables on which to enable the filter rules.
filterid_n
One or more filter IDs separated by space characters. These IDs identify the filter rules from the set of available table filters. You can enable these filters on the corresponding tables in the SMR subscription specified by subname
or in the MMR non-MDN node specified by dbid
. Use the printpubfilterslist
command to obtain the filter IDs for the available filter rules in the publication (see Printing a list of filters in a publication).
Examples
This example enables a filter rule on a subscription of a single-master replication system.
This example enables multiple filter rules on a primary node that isn't the primary definition node of a multi-master replication system.
- On this page
- Synopsis
- Parameters
- Examples