In trigger-based implementations (Informix and Microsoft SQL Server), 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 log-based implementations (DB2 Universal Database and Oracle), Sybase Replication Agent uses the native transaction log maintained by the primary database to obtain transactions.
The Replication Agents for UDB and for Oracle also create a
few user tables in the primary database to support their operation.
Before you initialize a Replication Agent that has a Replication Agent System Database (RASD), the primary database must be quiesced. Currently, only the Replication Agent for Oracle uses an RASD. The following procedure includes that quiesing.
Before you create the Replication Agent transaction log base objects, you can specify the object name prefix string that will be used to name transaction log objects. You can set this prefix string to avoid conflicts with the names of existing database objects in your primary database.
The value of the pdb_xlog_prefix parameter is the prefix string used in all Replication Agent transaction log component names. Use the ra_config command to change the value of the pdb_xlog_prefix parameter.
Replication Agent uses the value of pdb_xlog_prefix to
find its transaction log objects in the primary database. If you
change the value of pdb_xlog_prefix after
you create the transaction log, Replication Agent will not be able to find the
transaction log objects that use the old prefix.
Initializing transaction log objects is the same process for trigger-based Replication Agents (for Informix and Microsoft SQL Server) and log-based Replication Agents (for UDB and Oracle).
Primary databases require you to perform specific setup
tasks before you can initialize the Replication Agent transaction
log. See the Sybase Replication Agent Primary Database Guide to
verify that the required setup tasks have been performed for your
primary database.
To initialize a Replication Agent transaction log
Log in to the Replication Agent administration port.
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.
The 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
should use the default value.
To initialize the transaction log, use the following command:
pdb_xlog init
Releases of Replication Agent prior to 12.6 use the pxb_xlog command
with the create keyword to initialize the transaction
log. This keyword has been retained for backward compatibility,
but the init keyword is the correct and preferred
syntax to be used with the pdb_xlog command
When you invoke the pdb_xlog command with the init option, the Replication Agent does the following:
Checks the primary database for compatible settings.
Generates a SQL script that is run in the primary database. This script creates the Replication Agent transaction log base objects.
For Replication Agents that use a Replication Agent System Database (RASD), the RASD is initialized with information from the primary database.
Transaction log base objects must be created before
any objects can be marked for replication in the primary database.
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 Replicating state. See “Starting replication” for more information about putting the Replication Agent in Replicating state.
| Copyright © 2005. Sybase Inc. All rights reserved. |
|
|