Data Replication with SQL Remote
PART 3. SQL Remote Administration
CHAPTER 12. Administering SQL Remote for Adaptive Server Enterprise
This section describes how the Message Agent for Adaptive Server Enterprise works. There are some significant differences between how the Message Agent for Adaptive Server Enterprise and the Message Agent for Adaptive Server Anywhere operate, which accommodate the different roles of the two servers.
For information on features of the Message Agent that are common to Adaptive Server Anywhere and Adaptive Server Enterprise, see Running the Message Agent.
The Message Agent for Adaptive Server Enterprise is the following executable:
On Windows operating systems, the Message Agent is ssremote.exe
On UNIX operating systems, the Message Agent is ssremote.
The Message Agent scans the Adaptive Server Enterprise transaction log in order to collect transactions to be sent to remote databases. It stores these transactions in a stable queue.
For more information about the stable queue, see The stable queue. For more information about how the Message Agent uses the stable queue, see Message Agent operation phases.
The SQL Remote Message Agent uses the same transaction log scanning interface as the Adaptive Server Enterprise Log Transfer manager (LTM). Adaptive Server Enterprise maintains a truncation point, which is an identifier for the oldest page in the transaction log needed by the replication system.
The SQL Remote Message Agent sets the truncation point as soon as transactions are scanned from the transaction log and committed in the stable queue. This allows the dump transaction command to reclaim space in the transaction log as soon as possible. The Message Agent does not wait until confirmation is received from remote databases before setting the truncation point.
Message Agent must be run to reclaim log space |
Using SQL Remote on an Adaptive Server Enterprise database participating in a Replication Server setup may involve other considerations. If your database has a replication agent (LTM) running against it, then you need to use the SQL Remote Open Server as an additional component. Adaptive Server Enterprise databases have replication agents running against them in the following circumstances:
The database is participating in a Replication Server setup as a primary database, or
The database is participating in a Replication Server setup and is using asynchronous procedure calls.
If the database is participating in a Replication Server setup as a replicate site, and no asynchronous procedure calls are being used, there is no need for the SQL Remote Open Server.
For more information about the SQL Remote Open Server, see Using SQL Remote with Replication Server.
The Message Agent for Adaptive Server Enterprise uses a stable queue to hold transactions until they can be deleted. A stable queue is a pair of database tables that hold messages that may still be needed by the replication system.
SQL Remote for Adaptive Server Anywhere does not use a stable queue.
Stable queue not identical to Replication Server stable queue |
The stable queue may be kept in the same database as the tables being replicated, or in a different database. Keeping the stable queue in a separate database complicates the backup and recovery plan, but can improve performance by putting the stable queue workload on separate devices and/or a separate Adaptive Server Enterprise server.
Do not modify the stable queue directly |
The stable queue consists of two tables. The sr_transaction table has one row for each transaction in the stable queue, and the supplementary table sr_queue_state has a single row, which stores persistent global information about the state of the stable queue.
For a description of each of the columns of these tables, see Stable Queue tables.
The Message Agent has the following phases of execution:
Receiving messages During this phase, the Message Agent receives incoming messages and applies them to the Adaptive Server Enterprise server.
Populating the stable queue During this phase the Message Agent scans the Adaptive Server Enterprise transaction log into the stable queue.
Sending messages During this phase, the Message Agent builds outgoing messages from the stable queue.
The transactions remain in the stable queue until confirmation has been received from all remote databases. When confirmation is received, the transactions are automatically removed from the stable queue by the Message Agent.
The Message Agent does not scan the transaction log for the stable queue.
For information on running multiple copies of the Message Agent to carry out these tasks, see Running multiple Message Agents.