Creating a Table Replication Definition

Create a table replication definition to define a table data source for replication. The table replication definition, which Replication Server maintains, includes information about the columns to replicate and the location of the primary version of the data.

Prerequisites 

Make sure the Replication Server is running. Create and establish a connection to the server.

  1. Expand the tree for the Replication Server connection profile, right-click a primary database for which to create the replication definition, and select New Artifact.
  2. Select Table Replication Definition and click Next.

    You can also start this wizard by right-clicking the Table Replication Definitions folder for a primary database and choosing New Table Replication Definition from the context menu.

  3. Specify the primary data location, naming, and display options.
    Field Description
    Primary Location Select a Primary Connection Profile Type, Primary Connection Profile Name, Primary Server, and Primary Database.

    (Optional) Click Create to create a primary connection profile.

    Naming Specify a prefix and suffix for the replication definition:
    • Prefix for RepDef Name – enter a prefix for the table replication definition. By default, this field contains the connection profile name for your primary Replication Server, followed by an underscore. For example, the default prefix for a primary Replication Server profile named MyRepServer is "MyRepServer_".
    • Suffix for RepDef Name – enter a suffix for the table replication definition. The default suffix is "_rd".
    Display Select a display option:
    • Display All Tables – display all tables in the primary database.
    • Display Marked Tables Only – display only tables that are marked for replication.
    • Display by Name Pattern – display tables according to the name pattern specified in the text field. For example, to display all tables with names that begin with "p", enter p* and click Filter.
    Table Replication Definition Select tables in the grid. Use Select All and Deselect All to select or deselect all tables. Use Invert Selection to revert selections.
  4. Click Next, and set the column replication settings for each selected table.
    Field Description
    Replicated Tables Displays the tables selected for replication. Columns for the table highlighted in the Replicated Tables grid are shown in the Table Columns grid that follows.
    Table Columns Select columns and provide information for the following fields in the Table Columns grid, if necessary. By default, all columns are selected.
    • Column – displays column names for the specified table. This field is read-only.
    • Replicate As – specify the name by which you want this column to be known in the replicate table, which is the table to which this information is replicated. As a default, this field contains the column name of table to be replicated. To modify this value, double-click in the field, and enter the new column name.
    • Datatype – specify the datatype of the table column. As a default, this field contains the datatype specified in the DDL defining the table. To modify this value, enter a datatype or select an existing one.
    • Map To – specify the datatype to which you want this column to be mapped in the replicate table, which is the table to which this information is replicated. As a default, this field has the column datatype of the table to be replicated. To modify this value, enter a datatype or select an existing one.
    • PKey – specify the columns that comprise the primary key for the replicate table. By default, the primary key is the same as that for the table in the primary database.
    • Searchable – select for all columns you want to be searchable in the replicate table.
    • Nullible – select for the columns you want to be nullable in the replicate table. Only columns of type text, image, or raw object are nullable.
    • Replicate If Changed – select for all columns you want to be replicated in the event of changes to column data. You can select only columns of type text, image, or raw object.
    Click Invert Selection to invert the status for selected columns.
  5. Specify save and execution properties.
    Field Description
    Generate Script Generate a SQL file for the replication definition.
    Execute Immediately Execute the SQL code immediately. If you do not select this option, you must complete execution of the SQL file later to create the replication definition.
  6. Click Finish.
Related concepts
Replication Definition
Related tasks
Creating a Replication Definition
Creating a Database Replication Definition
Creating a Function Replication Definition
Editing a Replication Definition
Dropping a Replication Definition


Created June 25, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com