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

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!