Using DDL Filtering for Replication

The following options are supported for MySQL DDL replication:

Option Description

DDL INCLUDE OPTYPE CREATE OBJTYPE TABLE;

Include create table.

DDL INCLUDE OBJNAME ggvam.*

Include tables under the ggvamdatabase.

DDL EXCLUDE OBJNAME ggvam.emp*;

Exclude all the tables under the ggvam database and table name starting with the empwildcard.

DDL INCLUDE INSTR ‘XYZ’

Include DDL that contains this string.

DDL EXCLUDE INSTR ‘WHY’

Excludes DDL that contains this string.

DDL INCLUDE MAPPED

MySQL DDL uses this option and should be used as the default for Oracle GoldenGate MySQL DDL replication. DDL INCLUDE ALL and DDL are not supported.

DDL EXCLUDE ALL

Default option.

For a full list of options, see DDL in Reference for Oracle GoldenGate.

Using DDL Statements and Options

  • INCLUDE (default) means include all objects that fit the rest of the description. EXCLUDE means to omit items that fit the description. Exclude rules take precedence over include rules.

  • OPTYPE specifies the types of operations to be included or excluded. You can use CREATE and ALTER. Multiple OPTYPE can be specified using parentheses. For example, optype (create, alter). The asterisk (*) wildcard can be specified to indicate all operation types, and this is the default.

  • OBJTYPE specifies the TABLE operations to include or exclude. The wildcard can be specified to indicate all object types, and this is the default.

  • OBJNAME specifies the actual object names to include or exclude. For example, eric.*. Wildcards are specified as in other cases where multiple tables are specified. The default is *.

  • String indicates that the rule is true if any of the strings in stringspec are present (or false if excludestring is specified and the stringspec is present). If multiple string entries are made, at least one entry in each stringspec must be present to make the rule evaluate true.

    For example:
    ddlops string (“a”, “b”), string (“c”) evaluates true if string “a” OR “b” is present, AND string “c” is present
  • local is specified if you want the rule to apply only to the current Extract trail (the Extract trail to which the rule applies must precede this ddlops specification).

  • The semicolon is required to terminate the parameter entry.

    For example:

    ddl optype (create, drop), objname (eric.*);
    ddl exclude objname (eric.tab*);
    exttrail a;
    exttrail b;
    ddl optype (create), objname (joe.*), string (“abc”, “xyz”) local;
    ddl optype (alter), objtype (index);

    In this preceding example, the exttrail a gets creates and drops for all objects that belong to eric, except for objects that start with tab, exttrail a also gets all alter index statements, unless the index name begins with tab (the rule is global even though it’s included in exttrail b). exttrail b gets the same objects as a, and it also gets all creates for objects that belong to joe when the string abcor xyz is present in the DDL text. The ddlops.c module stores all DDL operation parameters and executes related rules.

Additionally, you can use the DDLOPTIONS parameter to configure aspects of DDL processing other than filtering and string substitution. You can use multiple DDLOPTIONS statements and Oracle recommends using one. If you are using multiple DDLOPTIONS statements, then make each of them unique so that one does not override the other. Multiple DDLOPTIONS statements are executed in the order listed in the parameter file.

See DDL and DDLOPTIONS.