Creating the Replication Agent transaction log

In trigger-based implementations (Informix, Microsoft SQL Server, and Oracle), Sybase Replication Agent uses its own proprietary transaction log to capture and record transactions in the primary database for replication. The Replication Agent transaction log consists of a set of database objects (tables, stored procedures, and triggers) that the Replication Agent creates in the primary database.

In the log-based implementation (DB2 Universal Database), Sybase Replication Agent uses the native transaction log maintained by the primary database to capture and record transactions. The Replication Agent for UDB also creates a few user tables in the primary database to support its operation.

Creating transaction log objects is the same process for both trigger-based and log-based Replication Agents.

NoteAll procedures in this book show isql used to log in to the administration port of the Replication Agent instance. You can use any other Open Client application to access the Replication Agent administration port.

StepsTo create a Replication Agent transaction log

  1. Log in to the Replication Agent administration port using the following command:

    isql -Uusername -Ppassword -Sinst_name
    

    where username is the Replication Agent administrative user login name, password is the corresponding password, and inst_name is the name of the Replication Agent instance you want to create a transaction log for.

    NoteIf you are logging in to a newly created Replication Agent instance for the first time, use the default administrative user login sa and leave the password blank.

  2. To define a prefix that uniquely identifies the Replication Agent transaction log you are creating, use the following command:

    ra_config pdb_xlog_prefix, string
    

    where string is a character string of one to three characters that will be used as a prefix for all database object names of the Replication Agent transaction log components created in the primary database.

    NoteThe default value of the pdb_xlog_prefix parameter is ra_. Unless this string poses a conflict with existing database object names in your primary database, you can use the default value.

  3. To create the transaction log, use the following command:

    pdb_xlog create
    

    When you invoke the pdb_xlog command with the create option, the Replication Agent generates a SQL script that is run in the primary database. This script creates the Replication Agent transaction log base objects.

    NoteTransaction log base objects must be created before any objects can be marked for replication in the primary database.

  4. To verify that the Replication Agent transaction log was created, use the following command:

    pdb_xlog
    

    When you invoke the pdb_xlog command with no options, Replication Agent returns a list of the transaction log base objects in the primary database, if the transaction log was created successfully. If no information is returned, the transaction log does not exist in the primary database.

When the Replication Agent transaction log exists, and both primary database and Replication Server connections are defined correctly, you can put the Replication Agent instance in the Replicating state.

StepsTo put the Replication Agent instance in the Replicating state

  1. Log in to the Replication Agent administration port and use the following command at the isql prompt:

    resume
    

    NoteThe Replication Agent instance will go to the Replicating state only if a connection for the primary database has been created in the primary Replication Server. For more information on creating the primary database connection in Replication Server, see the Sybase Replication Agent Installation Guide.

  2. To verify that the Replication Agent instance is in the Replicating state, use the following command at the isql prompt:

    ra_status
    

    The status information returned should indicate that the Replication Agent instance is in the Replicating state, which confirms that the transaction log exists and that all Replication Agent connections are up.