Replication Agents

A Replication Agent is a Replication Server client that retrieves information from the transaction log for a primary database and formats it for the primary Replication Server.

Replication Agent detects changes to primary data and, using Log Transfer Language (LTL), which is a subset of Replication Control Language (RCL), sends changes in primary data to the primary Replication Server.

A Replication Agent:

  1. Logs in to the Replication Server.

  2. Sends a connect source command to identify the session as a log transfer source and to specify the database for which transaction information will be transferred.

  3. Gets the name of the Maintenance User for the database from the Replication Server.

  4. Requests the secondary truncation point for the database from the Replication Server.

    This returns a value, called the origin queue ID, that the Replication Agent uses to find the location in the transaction log where it is to begin transferring transaction operations. The Replication Server has already received operations up to this location.

  5. Retrieves records from the transaction log, beginning at the record following the secondary truncation point, and formats the information into LTL commands.

Transaction logs

A Replication Agent can use one of two types of transaction logs:

Native transaction logs are used by the RepAgent thread (for Adaptive Server Enterprise) and the Replication Agents for DB2 Universal Database (the Replication Agent for DB2 UDB for OS/390, and Sybase Replication Agent).

A native database transaction log is the ideal source of information about changes to primary data because it is maintained by the database itself and it contains permanent, recoverable updates. If a Replication Agent cannot access the native transaction log of the primary database, the Replication Agent must use another source of reliable information.

Sybase Replication Agent (for Informix, Microsoft SQL Server, and Oracle) uses a transaction log that it creates and maintains in the primary database. The Sybase Replication Agent transaction log consists of database objects (triggers, tables, and procedures) in the primary database.

Sybase Replication Agent generates a SQL script that runs in the primary database. This script creates the Replication Agent transaction log components. See the Sybase Replication Agent Administration Guide for more information about the Sybase Replication Agent transaction log.

Replication Agent products

Replication Agent products extend the capabilities of Replication Server by supporting non-Sybase data servers as primary data servers in a Sybase replication system.

Sybase offers the following Replication Agent products for non-Sybase databases:

Replication Agent for DB2 UDB

Replication Agent for DB2 UDB for OS/390 fits into a replication system as follows:

The DB2 data server logs changes to rows in DB2 tables as they occur. The information written to the transaction log includes copies of the data before and after the changes. In DB2, these records are known as “undo” and “redo” records. Control records are written for commits and aborts. These records are translated to commit and rollback operations.

The DB2 log consists of a series of data sets. Sybase Log Extract uses these log data sets to identify DB2 data changes. Since DB2 writes change records to the active log as they occur, Sybase Log Extract can process the log records immediately after they are entered.

Sybase Replication Agent

Sybase Replication Agent is the component that captures transactions in DB2 Universal Database, Informix, Microsoft SQL Server, or Oracle primary databases on UNIX and Microsoft Windows platforms.

Sybase Replication Agent is implemented in the Java programming language. Therefore, you must have a Java Runtime Environment (JRE) installed on the computer that will act as the Replication Agent host machine.

Sybase Replication Agent uses the Java Database Connectivity (JDBC) protocol for all of its communications. It uses a single instance of the Sybase JDBC driver (jConnect™ for JDBC™) to manage all of its connections to Open Client/Server applications, including the primary Replication Server. In the case of the primary data server, Sybase Replication Agent connects to the JDBC driver for the primary database.