How DDL is Evaluated for Processing
This topic explains how Oracle GoldenGate processes DDL statements on the source and target systems.
It shows the order in which different criteria in the Oracle GoldenGate parameters are processed, and it explains the differences between how Extract and Replicat each process the DDL.
Extract
-
Extract captures a DDL statement.
-
Extract separates comments, if any, from the main statement.
-
Extract searches for the
DDLparameter. (This example assumes it exists.) -
Extract searches for the
IGNOREREPLICATESparameter. If it is present, and if Replicat produced this DDL on this system, Extract ignores the DDL statement. (This example assumes no Replicat operations on this system.) -
Extract determines whether the DDL statement is a
RENAME. If so, the rename is flagged internally. -
Extract gets the base object name and, if present, the derived object name.
-
If the statement is a
RENAME, Extract changes it toALTER TABLE RENAME. -
Extract searches for the
DDLOPTIONS REMOVECOMMENTS BEFOREparameter. If it is present, Extract removes the comments from the DDL statement, but stores them in case there is aDDL INCLUDEorDDL EXCLUDEclause that usesINSTRorINSTRCOMMENTS. -
Extract determines the DDL scope:
MAPPED,UNMAPPEDorOTHER:-
It is
MAPPEDif the operation and object types are supported for mapping, and the base object name and/or derived object name (ifRENAME) is in aTABLEparameter.
-
It is
UNMAPPEDif the operation and object types are not supported for mapping, and the base object name and/or derived object name (ifRENAME) is not in aTABLEparameter. -
Otherwise the operation is identified as
OTHER.
-
-
Extract checks the
DDLparameter forINCLUDEandEXCLUDEclauses, and it evaluates theDDLparameter criteria in those clauses. All options must evaluate toTRUEin order for theINCLUDEorEXCLUDEto evaluate toTRUE. The following occurs:-
If an
EXCLUDEclause evaluates toTRUE, Extract discards the DDL statement and evaluates another DDL statement. In this case, the processing steps start over. -
If an
INCLUDEclause evaluates toTRUE, or if theDDLparameter does not have anyINCLUDEorEXCLUDEclauses, Extract includes the DDL statement, and the processing logic continues.
-
-
Extract searches for a
DDLSUBSTparameter and evaluates theINCLUDEandEXCLUDEclauses. If the criteria in those clauses add up toTRUE, Extract performs string substitution. Extract evaluates the DDL statement against eachDDLSUBSTparameter in the parameter file. For all trueDDLSUBSTspecifications, Extract performs string substitution in the order that theDDLSUBSTparameters are listed in the file. -
Now that
DDLSUBThas been processed, Extract searches for theREMOVECOMMENTS AFTERparameter. If it is present, Extract removes the comments from the DDL statement. -
Extract searches for
DDLOPTIONS ADDTRANDATA. If it is present, and if the operation isCREATE TABLE, Extract issues theALTER TABLEnameADD SUPPLEMENTAL LOG GROUPcommand on the table. -
Extract writes the DDL statement to the trail.
Replicat
-
Replicat reads the DDL statement from the trail.
-
Replicat separates comments, if any, from the main statement.
-
Replicat searches for
DDLOPTIONS REMOVECOMMENTS BEFORE. If it is present, Replicat removes the comments from the DDL statement. -
Replicat evaluates the DDL synchronization scope to determine if the DDL qualifies for name mapping. Anything else is of
OTHERscope. -
Replicat evaluates the
MAPstatements in the parameter file. If the source base object name for this DDL (as read from the trail) appears in any of theMAPstatements, the operation is marked asMAPPEDin scope. Otherwise it is marked asUNMAPPEDin scope. -
Replicat replaces the source base object name with the base object name that is specified in the
TARGETclause of theMAPstatement. -
If there is a derived object, Replicat searches for
DDLOPTIONS MAPDERIVED. If it is present, Replicat replaces the source derived name with the target derived name from theMAPstatement. -
Replicat checks the
DDLparameter forINCLUDEandEXCLUDEclauses, and it evaluates theDDLparameter criteria contained in them. All options must evaluate toTRUEin order for theINCLUDEorEXCLUDEto evaluate toTRUE. The following occurs:-
If any
EXCLUDEclause evaluates toTRUE, Replicat discards the DDL statement and starts evaluating another DDL statement. In this case, the processing steps start over. -
If any
INCLUDEclause evaluates toTRUE, or if theDDLparameter does not have anyINCLUDEorEXCLUDEclauses, Replicat includes the DDL statement, and the processing logic continues.
-
-
Replicat searches for the
DDLSUBSTparameter and evaluates theINCLUDEandEXCLUDEclauses. If the options in those clauses add up toTRUE, Replicat performs string substitution. Replicat evaluates the DDL statement against eachDDLSUBSTparameter in the parameter file. For all trueDDLSUBSTspecifications, Replicat performs string substitution in the order that theDDLSUBSTparameters are listed in the file. -
Now that
DDLSUBThas been processed, Replicat searches for theREMOVECOMMENTS AFTERparameter. If it is present, Replicat removes the comments from the DDL statement. -
Replicat executes the DDL statement on the target database.
-
If there are no errors, Replicat processes the next DDL statement. If there are errors, Replicat performs the following steps.
-
Replicat analyzes the
INCLUDEandEXCLUDErules in the ReplicatDDLERRORparameters in the order that they appear in the parameter file. If Replicat finds a rule for the error code, it applies the specified error handling; otherwise, it appliesDEFAULThandling. -
If the error handling does not enable the DDL statement to succeed, Replicat does one of the following: abends, ignores the operation, or discards it as specified in the rules.
Note:
If there are multiple targets for the same source in a MAP statement, the processing logic executes for each one.