Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Installing Data Replication
  4. Preparing Source and Target Systems
  5. Replication Basic Concepts
  6. InitialSync Processing
  7. Extractor and Applier Processing
  8. DDL Replication
  9. Recovery and Checkpoint Processing
  10. Configuring the Server Manager
  11. Creating Replication Configurations in the Data Replication Console
  12. Managing Replication Configurations
  13. Running Data Replications
  14. Configuring Selected Replication Types
  15. Monitoring Data Replication
  16. Maintaining the Replication Environment
  17. Troubleshooting
  18. Data Replication Files and Subdirectories
  19. Data Replication Runtime Parameters
  20. InitialSync, Extractor, and Applier Command Line Parameters
  21. Server Manager Command Line Parameters
  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

Examples of DDL Replication

Examples of DDL Replication

Review the following examples to learn how to replicate DDL operations from a source to a target. These examples demonstrate the replication of basic DDL operations in SQL Apply, Audit Apply, and Merge Apply modes.
  • Example 1
    . Replicate a CREATE TABLE operation from a Microsoft SQL Server source to an Oracle target in SQL Apply mode.
    The following DDL operation occurs on the Microsoft SQL Server source:
    CREATE TABLE [dbo].[TABLE_DEMO]( [IDKEY] [int] NOT NULL PRIMARY KEY, [DATA] [varchar](20) NULL );
    Because you enabled the replication of CREATE TABLE operations for the "dbo" SQL Server owner and the "ORA_TARGET" Oracle schema, Data Replication executes the following statement on the Oracle target to create an identical Oracle table with the schema name "ORA_TARGET":
    CREATE TABLE "ORA_TARGET"."TABLE_DEMO" ( "IDKEY" NUMBER (10, 0) NOT NULL, "DATA" VARCHAR2(20) NULL, PRIMARY KEY ("IDKEY") )
  • Example 2
    . Replicate an ADD COLUMN operation from a Microsoft SQL Server source to an Oracle target in Audit Apply mode.
    The following DDL operation adds the INTDATA column to the TABLE_DEMO table on the Microsoft SQL Server source:
    ALTER TABLE [dbo].[TABLE_DEMO] ADD [INTDATA] INTEGER;
    Because you enabled replication of ADD COLUMN operations for the TABLE_DEMO source table, Data Replication creates two columns in the corresponding audit log table on the target for the before and after values in the INTDATA column. Data Replication executes the following statement on the Oracle target:
    ALTER TABLE "ORA_TARGET"."TABLE_DEMO_LOG" ADD ("INTDATA_OLD" NUMBER(10) NULL , "INTDATA_NEW" NUMBER(10) NULL )
  • Example 3
    . Replicate a CREATE TABLE operation from an Oracle source to a Netezza target in Merge Apply mode.
    The following DDL operation occurs on the Oracle source:
    CREATE TABLE ORA_SOURCE.TABLE_DEMO ( IDKEY NUMBER(22,0) NOT NULL PRIMARY KEY, DATA VARCHAR2(20) );
    Because you enabled replication of CREATE TABLE operations for the "ORA_SOURCE" source schema and the "NZ_TARGET" target schema, Data Replication creates a corresponding target table and audit log table on the target. Data Replication executes the following statements on the Netezza target:
    CREATE TABLE "NZ_TARGET"."TABLE_DEMO" ( "IDKEY" NUMERIC(22,0) NOT NULL, "DATA" VARCHAR(20) NULL ) CREATE TABLE "NZ_TARGET"."TABLE_DEMO_LOG" ( "OP_TIME" TIMESTAMP , "OP_CODE" CHAR(1) NOT NULL, "OP_CMT_SCN" NUMERIC(20) NOT NULL, "OP_CMT_TIME" TIMESTAMP , "OP_XID" NUMERIC(22) , "OP_NUM_IN_TX" BIGINT NOT NULL, "OP_KEY_LEVEL" INTEGER , "OP_ROOT_KEY_ROWID" BIGINT , "IDKEY_OLD" NUMERIC(22,0) NOT NULL, "IDKEY_NEW" NUMERIC(22,0) NOT NULL, "DATA_OLD" VARCHAR(20) NULL, "DATA_NEW" VARCHAR(20) NULL )
    Because Netezza does not use indexes, Data Replication ignores the primary key definition in the source table.

0 COMMENTS

We’d like to hear from you!