If you are upgrading Adaptive Server in your replication system, use the database upgrade procedure as follows:
Suspend transaction processing and replication system activities.
Drain transaction logs for primary databases.
Drain the RSSD transaction log.
Disable the secondary truncation point.
Upgrade Adaptive Server.
Restore Replication after upgrade.
WARNING! Sybase strongly recommends you perform a dump database and dump transaction before executing the steps below.
Complete the following tasks before upgrading the Adaptive Servers in your replication system.
Suspend transaction activity in the databases and suspend replication.
Replication includes creating and dropping both routes and subscriptions.
Verify that the subscriptions you are creating with the create subscription command, with primary data in the databases being upgraded, have reached a “valid” state at the primary Replication Server.
Do not upgrade while the above subscriptions are being created.
Make sure no users create subscriptions for the data in the database you are upgrading until the upgrade procedure is finished.
Run rs_helproute in each Replication Server System Database (RSSD) being upgraded to determine each RSSD’s status.
The status of all routes should be “Active.” See Chapter 6, “Managing Routes” in the Replication Server Administration Guide Volume 1, to resolve route problems.
Shut down the applications that are using the databases you are upgrading.
Use the admin who command in Replication Server to identify the existing Data Server Interface (DSI) connections to the data server being upgraded.
Suspend all DSI connections to non-RSSD databases you are upgrading by using the following command for each database:
suspend connection to dataserver.database
Leave the DSI connections for the RSSDs running.
For each primary database you are upgrading, follow these steps to ensure that the Replication Server completely processes the pre-upgrade log.
Wait for all remaining transactions to be replicated.
Run this Replication Server command:
admin who, sqm
Find the entry that corresponds to the inbound queue for this database by looking for the Info field for the queue_number, queue_type entry. For an inbound queue, the queue type is 1. Note the last segment:block entry for the queue.
Open the queue dump file by executing the following Replication Server command, where file_name is the name of the dump file you will dump to:
sysadmin dump_file, "file_name"
Create a dummy table to check that the Replication Server has received the latest log record written in the log. You can drop this table later on.
create table dummy (c1 int, c2 char(255)) go sp_setreptable dummy, true go begin tran go insert dummy values (1,'hello') go 10 commit tran go
In the primary Replication Server, execute the admin who, sqm command until the last segment:block entry for the inbound queue changes.
Execute the following Replication Server command to dump the last block of the inbound queue to the dump file you created in step 3:
sysadmin dump_queue, queue_number, queue_type, last_seg, block, 1
Use the queue_number, queue_type, last_seg, and block values found in the output of the admin who, sqm command in step 5.
Examine the dump file to make sure it contains the transaction corresponding to the inserts you performed in step 4 (you can use an editor to examine the file).
Repeat steps 5 through 7 until the transaction corresponding to the update is in the dump file. After draining the transaction logs, do not allow any other activity in the databases. If activity does occur, you need to redrain the transaction logs.
Manually drain the transaction log of each primary RSSD in the data server you are upgrading.
If Replication Server has routes to other Replication Servers, make sure that Replication Server processes all transactions in the RSSD transaction log before you upgrade the databases.
You can make sure the transaction log is completely processed by creating a replication definition in the primary Replication Server and then watching for it to appear in the replicate Replication Server RSSD. When the replication definition is in the replicate RSSD, the log is fully processed.
Creating a replication definition for ensuring that the RSSD log is processed
Log in to the primary Replication Server.
Create a temporary replication definition:
create replication definition rep_def_name with primary at dataserver.database (column_a int) primary key (column_a)
Log in to the replicate RSSD.
Execute the following query to see whether the replication definition has arrived from the primary RSSD:
select * from rs_objects where objname = "rep_def_name"
When the replication definition has arrived in the replicate RSSD, the RSSD transaction log has been drained.
When you upgrade a primary database, the Replication Agent must not be running and the secondary truncation point should be turned off for the duration of the upgrade.
Shut down the Replication Agents or make sure that dbcc logtransfer is not running for the databases that is being upgraded.
Shut down Replication Servers for the RSSDs you are upgrading.
In each primary database including RSSDs, execute the following commands to turn off the secondary truncation point:
1> use database 2> go 1> dbcc settrunc ("ltm", "ignore") 2> go
Repeat step 3 for each primary database and each primary RSSD.
For information on upgrading Adaptive Server, see the Adaptive Server Enterprise Installation Guide for your platform.
Zero out the locator in the RSSD for each replicated primary.
Using isql, connect to the RSSD and execute the following commands:
1> use RSSD 2> go 1> rs_zeroltm dataserver, RSSD 2> go
Set the secondary truncation point to “valid” in each primary database. Using isql, connect to the replicated primary database, and execute the following commands:
1> use database 2> go 1> dump tran database with truncate_only 2> go 1> dbcc settrunc("ltm","valid") 2> go