Changing the Character Set or Sort Order

Change the character set or sort order in Replication Server.

All replicated transactions originating from Adaptive Server must arrive at the replicate data server before you can modify the character set or sort order. In addition to changing the sort order or character set, this procedure ensures that no data corruption occurs resulting from changing the character set or sort order.

  1. Identify all Replication Servers and Adaptive Servers that are associated with the primary Adaptive Server—including all RSSDs for associated Replication Servers.

    If you are changing the character set: look up the character set of all Adaptive Servers in the Replication Server domain to ascertain if their character sets must also be changed. Sybase supports alternate character sets for servers in the same domain, but the implication for users is significant.

    If you are changing the sort order: Sybase recommends that all data servers in the Replication Server domain share the same sort order. This ensures that data and identifiers are ordered consistently throughout the replication system.

  2. Quiesce all primary updates and make sure that they have been processed by Replication Server.

    If you are changing the character set, make sure that there are sufficient empty transactions to span a page in Adaptive Server. This ensures that after the Adaptive Server transaction log is emptied (see step 9), no data remains in the old character set.

  3. Quiesce all associated Replication Servers.
  4. Shut down all associated Replication Servers, RepAgents, and Replication Agents.
  5. Change the character set and sort order in configuration files for the Replication Servers and, if applicable, for the Replication Agents.
  6. Follow Adaptive Server procedures for changing the default character set and sort order of each associated Adaptive Server. See Adaptive Server Enterprise System Administration Guide Volume 1 > Configuring Character Sets, Sort Orders, and Languages.
  7. Shut down all associated Adaptive Servers.
  8. Start the associated Adaptive Servers in single-user mode—unless you can guarantee that there will be no activity at the primary and replicate databases.
  9. Remove the secondary truncation point from each associated Adaptive Server. This step allows Adaptive Server to truncate log records that the RepAgent has not yet transferred to the Replication Server. From the Adaptive Server, enter:
    dbcc settrunc('ltm', 'ignore')
  10. Truncate the transaction log. From the Adaptive Server, enter:
    dump transaction db_name with truncate_only
  11. Reset the secondary truncation point. From the Adaptive Server, enter:
    dbcc settrunc('ltm', 'valid')
  12. Reset the locator value for the primary database to zero. This step instructs Replication Server to get the new secondary truncation point from Adaptive Server and set the locator to that value. From the Adaptive Server, enter:
    rs_zeroltm data_server, db_name
  13. Shut down and restart Adaptive Server in normal mode.
  14. Restart the associated Replication Servers.
  15. Allow RepAgents (or Replication Agents) to reconnect to Replication Servers by resuming log transfer. From the Replication Server, enter:
    resume log transfer from data_server.db_name
  16. Start RepAgents.
  17. Restart replication.