Using Automatic Schema Evolution
Oracle GoldenGate supports two mechanisms to keep the target objects in sync with the schema changes on the source objects, that are part of the data replication:
-
DDL Replication
-
Automatic Schema Evolution
DDL Replication is supported for Oracle to Oracle, and MySQL to MySQL only. It can be enabled either on all objects in the Replicat run, or can be confined to selected object names or types using the using the DDL INCLUDE/EXCLUDE statements along with OBJTYPE/OBJNAME options. Similar support has been provided for the AUTOSCHEMA functionality.
Automatic Schema Evolution functionality supports multiple databases in both homogeneous and heterogeneous topologies. For keeping the schema of the source and the target table sychronized, Automatic Schema supports the following operations based on the schema changes detected from the metadata records in the GoldenGate trail files:
- Creating the missing table on the target database.
- Altering the target table by performing
ADD/MODIFY/DROPcolumns.
Based on every source column metadata, by default the best-fit data type is chosen for the corresponding target column.
NOTE: Before using the Automatic Schema Evolution feature, you must check the documentation to review the default data type mappings applicable for their specific source database to target database replication scenario. See Supported Operations with Automatic Schema Evolution and Data Type Mapping for details.
The target data types may not be exactly same as the source data type in all the cases. Wherever possible, the choice of target data type is made such that the target type is always compatible and large enough (with same size as the source column or wider) to be able to accommodate the corresponding source column’s data. In some cases where there is no appropriate type available for corresponding source column data type on the target database (like the available types on the target database may cause data truncation), an error is returned with an appropriate recommendation.