Replicating Data Definition Language (DDL) changes
SQL statements are divided into two categories: Data Definition Language (DDL) and Data Manipulation Language (DML). DDL statements are used to describe a database, to define its structure, to create its objects and to create the table's sub-objects.
The following list provides some examples of types of DDL statements:
- Creating tables (CREATE command)
- Modifying the structure of a table (ALTER command) without deleting and re-creating it, such as adding columns, removing columns or changing column definitions (for example, length or default values)
- Removing objects (such as tables) from the database (DROP command)
- Partitioning tables (PARTITION command)
DML statements are used to control the information contained within the database. The following lists provides some examples of types of DML statements:
- Adding records to a table (INSERT command)
- Modifying information in a table (UPDATE command)
- Removing records from a table (DELETE command)
While all CDC Replication replication engines can replicate DML changes, the CDC Replication Engine for Oracle databases and the CDC Replication Engine for Db2® Database also include support for replicating DDL changes, enabling simplified and more automated change management. Data changes continue to be replicated, but you no longer have to manually update subscription information when the structure of a table changes if you are using the DDL replication feature. For example, new tables and columns are added according to the DDL statement.
Although a wide array of DDL operations exist, CDC Replication replicates only those that are related to tables and characteristics of tables; it does not replicate the larger context of the database.