rs_create_repdef

(Oracle and Microsoft SQL Server only) Creates a replication definition at Replication Server for a specific marked table and procedure, or for all marked tables and procedures.

Note: This command is available only for Oracle and Microsoft SQL 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.

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.

  • 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.

  • For each table or procedure for which a replication definition create is attempted, a result set is returned. The result set contains the replication definition name and status of the create. If the replication definition was created, the status will be “created.” If an error occurred, an error message from Replication Server will be returned.

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

  • The following applies to replication definition table and procedure names:
    • All non-alphanumeric characters and spaces are removed and are not part of the table or procedure name.

    • Underscores are kept as part of the name even though they are non-alphanumeric characters.

    • Periods are replaced with underscores.

  • Replication definition names for tables always begin with the prefix “ra$,” followed by a unique alphanumeric identifier (maximum of 8 characters), and ending with a table or object name. For example, for a replicate name of “My Table,” the resulting replication definition name is “ra$0x7952_mytable.” For an especially long replicate name of “mytable89012345678901234567890” (30 characters), the resulting replication definition name is “ra$0x7952_mytable8901234567890” (30 or 255 characters maximum, depending on whether or not the pdb_support_large_identifier configuration parameter is set).

  • 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