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 Wildcard Expressions for Table and Column Mappings

Review the following examples to learn how to define table and column mappings for different apply modes based on wildcard expressions. You define the mappings in the
Wildcard Mapping
dialog box.
Map the following source tables and columns to Microsoft SQL Server target tables and columns in SQL Apply mode:
  • TABLE1 on the source and dbo.TABLE1_TGT on the target.
    • COL1 on the source and COL1 on the target.
    • COL2 on the source and COL2 on the target.
  • TABLE2 on the source and dbo.TABLE2_TGT on the target.
    • COL1 on the source and COL1 on the target.
    • COL2 on the source and COL2 on the target.
The SQL Server target table names include the owner name dbo and the suffix _TGT.
Complete the following steps:
  1. In the
    Mapping Method
    field, select
    SQL Apply
    .
  2. In the
    Source Table
    field, enter the
    *
    wildcard only.
  3. In the
    Target Tables
    field, enter dbo.
    *_TGT
    to select all target tables of the dbo owner with table names that end with the _TGT.
    In the list box at the bottom of the
    Wildcard Mapping
    dialog box, the Data Replication Console matches TABLE1 to dbo.TABLE1_TGT and matches TABLE2 to dbo.TABLE2_TGT.
  4. To map these tables, click
    Map
    .
You do not need to enter wildcard expressions for the column mappings because the source and target tables have identical column names.
Map the following source and target tables and columns in Merge Apply mode:
  • TABLE_SRC_1 on the source and TABLE_TGT_1 on the target.
    • COL_SRC_1 on the source and COL_TGT_1 on the target.
    • COL_SRC_2 on the source and COL_TGT_2 on the target.
  • TABLE_SRC_2 on the source and TABLE_TGT_2 on the target.
    • COL_SRC_1 on the source and COL_TGT_1 on the target.
    • COL_SRC_2 on the source and COL_TGT_2 on the target.
Use wildcard expressions for both the table and column mappings.
Complete the following steps:
  1. In the
    Mapping Method
    field, select
    Merge Apply
    .
  2. In the
    Source Tables
    field, enter
    *SRC*
    to select all source tables with table names that include SRC in the middle of the names.
  3. In the
    Target Tables
    field, enter
    *TGT*
    to select all target tables with table names that include TGT in the middle of the names.
    The Data Replication Console matches TABLE_SRC_1 to TABLE_TGT_1 and matches TABLE_SRC_2 to TABLE_TGT_2.
  4. In the
    Source Columns
    field, enter
    *SRC*
    .
  5. In the
    Target Columns
    field, enter
    *TGT*
    .
    In the list box at the bottom, double-click the TABLE_SRC_1 row to view column matches. Then view columns matches for TABLE_SCR_2 in the same way.
  6. Click
    Map
    .
Map the following source tables to the target audit log tables in Audit Apply mode. The source and target table names have different prefixes, and the target audit log table names include the _LOG suffix that is specified on the
Runtime Settings
tab >
Calculated Columns
view.
  • SRC_TABLE1 on the source and TGT_TABLE1_LOG on the target.
    • COL1 on the source and a pair of COL1_NEW and COL1_OLD columns on the target.
    • COL2 on the source and a pair of COL2_NEW and COL2_OLD columns on the target.
  • SRC_TABLE2 on the source and TGT_TABLE2_LOG on the target.
    • COL1 on the source and a pair of COL1_NEW and COL1_OLD columns on the target.
    • COL2 on the source and a pair of COL2_NEW and COL2_OLD columns on the target.
Complete the following steps:
  1. In the
    Mapping Method
    field, select
    Audit Apply
    .
  2. In the
    Source Table
    field, enter
    SRC*
    to select all source tables with table names that begin with SRC.
  3. In the
    Target Tables
    field, enter
    TGT*
    to select the audit log tables with table names that begin with TGT and end with the suffix _LOG.
    The Data Replication Console matches SRC_TABLE1 to TGT_TABLE1_LOG and matches SRC_TABLE2 to TGT_TABLE2_LOG.
  4. To map these tables, click
    Map
    .
Map the following source and target tables and columns in SQL Apply mode. The tables have identical table names, but the columns have different column names.
  • TABLE1 on the source and TABLE1 on the target.
    • COL1_SRC on the source and COL1_TGT on the target.
    • COL2_SRC on the source and COL2_TGT on the target.
  • TABLE2 on the source and TABLE2 on the target.
    • COL1_SRC on the source and COL1_TGT on the target.
    • COL2_SRC on the source and COL2_TGT on the target.
Use wildcard expressions for both the table and column mappings.
Complete the following steps:
  1. In the
    Mapping Method
    field, select
    SQL Apply
    .
  2. In the
    Source Table
    and
    Target Tables
    fields, enter
    *
    to map source and target tables that have identical names.
    The Data Replication Console matches the TABLE1 source table to the TABLE1 target table and matches the TABLE2 source table to the TABLE2 target table.
  3. In the
    Source Columns
    field, enter
    *SRC
    .
  4. In the
    Target Columns
    field, enter
    *TGT
    .
    In the list box at the bottom, double-click the TABLE1 row to view column matches. Then view column matches for TABLE2 in the same way.
  5. To map these tables, click
    Map
    .
Map the following source and target tables and columns in SQL Apply mode:
  • SRC_TABLE1_GRP1 on the source and GROUP1_TABLE1_TGT on the target.
    • COL1 on the source and COL1 on the target.
    • COL2 on the source and COL2 on the target.
  • SRC_TABLE2_GRP3 on the source and GROUP3_TABLE2_TGT on the target.
    • COL1 on the source and COL1 on the target.
    • COL2 on the source and COL2 on the target.
Complete the following steps:
  1. In the
    Mapping Method
    field, select
    SQL Apply
    .
  2. In the
    Source Tables
    field, enter
    SRC_*_GRP*
    .
  3. In the
    Target Tables
    field, enter
    GROUP$2_$1_TGT
    .
    The $2 wildcard matches against the capturing group that is represented by the second asterisk in the
    Source Tables
    field, which is a group ID. The $1 wildcard matches against the capturing group that is represented by the first asterisk, which is a table ID. As a result, the target table matching strings contain the group and table IDs in the reverse order from the source matching strings.
    Based on these source and target expressions, the Data Replication Console matches SRC_TABLE1_GRP1 to GROUP1_TABLE1_TGT and matches SRC_TABLE2_GRP3 to GROUP3_TABLE2_TGT.
  4. Click
    Map
    .
You do not need to enter wildcard expressions for the column mappings because the source and target tables have identical column names.

0 COMMENTS

We’d like to hear from you!