Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Understanding Data Replication
  4. Sources - Preparation and Replication Considerations
  5. Targets - Preparation and Replication Considerations
  6. Starting the Server Manager
  7. Getting Started with the Data Replication Console
  8. Defining and Managing Server Manager Main Servers and Subservers
  9. Creating and Managing User Accounts
  10. Creating and Managing Connections
  11. Creating Replication Configurations
  12. Materializing Targets with InitialSync
  13. Scheduling and Running Replication Tasks
  14. Implementing Advanced Replication Topologies
  15. Monitoring Data Replication
  16. Managing Replication Configurations
  17. Handling Replication Environment Changes and Failures
  18. Troubleshooting
  19. Data Replication Files and Subdirectories
  20. Data Replication Runtime Parameters
  21. Command Line Parameters for Data Replication Components
  22. Updating Configurations in the Replication Configuration CLI
  23. DDL Statements for Manually Creating Recovery Tables
  24. Sample Scripts for Enabling or Disabling SQL Server Change Data Capture
  25. Glossary

Order in Which Data Replication Applies DDL Operations

Order in Which Data Replication Applies DDL Operations

If you replicate source DDL and DML operations within one apply cycle, the Applier applies all of the DDL changes prior to applying the DML changes.
The following cases pertain to the order in which DDL operations are applied within an apply cycle:
  • If you update a NULL value in the column to set a value other than NULL and then run an ALTER COLUMN statement that adds a NOT NULL constraint to this column in the same replication cycle, the Applier fails.
    For example, replicate the following source statements in the first cycle:
    CREATE TABLE test (col1 NUMBER NOT NULL, col2 NUMBER NULL); INSERT INTO test (col1, col2) VALUES (1, NULL); COMMIT;
    Then replicate the following statements in the second cycle:
    UPDATE tst SET col2 = 0 WHERE col1 = 1; COMMIT; ALTER TABLE tst MODIFY (col2 NOT NULL);
    In the second cycle, the Applier first replicates the ALTER TABLE operation but fails to set the NOT NULL constraint for the column that stores the NULL value.
  • If you insert data into a source table and then modify the datatype of a table column in the same apply cycle, the Applier processes the column datatype change prior to applying the Inserts to the target. When the Applier applies the Inserts to the target, it does not insert data into the column with the modified datatype.
  • If you make DML changes to a source table and then drop this table in the same apply cycle, the Applier processes the DROP TABLE operation and removes the mapping from the configuration first. Then the Applier skips the DML changes that were captured for this table.

0 COMMENTS

We’d like to hear from you!