rs_create_repdef

Creates a replication definition at Replication Server for a specific marked table and procedure, or for all marked tables and procedures.

Note: Before you create a new replication definition by using rs_create_repdef, make sure that a replication definition with the same name does not already exist in Replication Server.

Replication Agent is pre-configured to match replication definition datatypes available in Replication Server 15.0 and later. If replication definitions are to be generated against an earlier version of Replication Server, this configuration needs to be changed. Contact Sybase Technical Support for assistance in making this adjustment.

If the version of Replication Server that connects to Replication Agent is 15.5 and later, Replication Agent does not add the replicate minimal columns clause when creating replication definitions. You can control minimal columns on DSI by using the Replication Server replicate_minimal_columns parameter. If the version of Replication Server is 15.2 and earlier, Replication Agent adds the replicate minimal columns clause to the replication definitions.

Syntax

rs_create_repdef {all | name}

Parameters

Usage

  • The rs_username user must have create object permission before Replication Agent can use it to create replication definitions from Replication Server. You must grant this permission manually from the RSSD.

  • When a table is marked for replication and the owner mode is set to on, the replication definition created by rs_create_repdef includes the owner name as part of the table name for a table replication definition in the with primary table named clause.

  • This command always assumes that a database replication definition exists for the primary database. All replication definitions created by rs_create_repdef include the send standby clause, which means the replication definition will only be used by Replication Server if there is already a database level replication definition. The replication definition created by rs_create_repdef cannot be individually subscribed to. If you do not wish to have a database level replication definition, you must use a different tool, or create replication definitions manually, and not use rs_create_repdef.

  • Replication definitions created by rs_create_repdef always define the datatypes using available user defined datatypes that are installed in Replication Server. This means that customers using rs_create_repdef should not set Replication Agent configuration parameter pdb_convert_datetime to true, as doing so converts date and timestamp datatypes to Sybase format, instead of UDD format.

  • Using the Replication Agent configuration parameter pdb_auto_create_repdefs has the same result as executing rs_create_repdef.

  • When rs_create_repdef is invoked and the parameter “all” or “ALL” is entered, a replication definition is created for all tables or procedures that are marked for replication. If there is a duplication of the replication definition for one or several objects, Replication Agent logs a warning message.

  • When rs_create_repdef is invoked and the name of a table or procedure that is marked for replication is entered, a replication definition is created only for that table or procedure. If there is a duplication of the replication definition, rs_create_repdef fails and returns an error message.

  • For each table or procedure for which a replication definition create is attempted, a result set is returned. The result set contains the table or procedure name, replication definition name, and the status of the create replication definition process. If the replication definition is created successfully, the status column display value (created) displays. Otherwise, Replication Server displays an error message.

  • The character case of the object names in the replication definition will be set according to the ltl_character_case setting.

  • The naming convention for replication definition is:

    ra$<rs_source_ds>_<rs_source_db>_<owner>_<objname>

    where:

    ra$ is the prefix for all replication definition names.

    <rs_source_ds> is the value of the rs_source_ds parameter.

    <rs_source_db> is the value of the rs_source_db parameter.

    <owner> is the user name of the object owner in primary database.

    <objname> is the object name in primary database.

    The maximum length of the replication definition name is 255 characters. Replication Agent truncates the name exceeding 255 characters. It also replaces the last n characters of the replication definition name with the object ID in hexadecimal format, where n is the length of the object ID in hexadecimal.

  • For date columns, the rs_create_repdef command creates a replication definition with a column datatype defined that assumes the Replication Agent pdb_convert_datetime configuration parameter is set to false. If pdb_convert_datetime is set to true, the format of the date value does not match the format expected by Replication Server. To avoid this problem, change the pdb_convert_datetime configuration parameter to false, or manually create the replication definitions (without using the rs_create_repdef command).

Related reference
rs_drop_repdef