Draining the Transaction Logs for Primary Databases

Ensure that the Replication Server on each primary database you are upgrading completely processes the pre-upgrade log.

Follow these steps to ensure the transaction log is completely drained off.

  1. Wait for all remaining transactions to be replicated.
  2. Check that a manual update on a replicate table is forwarded to Replication Server:
    1. If the database is enabled for Replication Agent:
      1> use <dbname>
      2> go
      1> sp_config_rep_agent <dbname>, “traceon”, “9201”
      2> go
      If you cannot access the console where Adaptive Server is running, you must also define a trace log file to check the information Replication Agent will send to it:
      1> sp_config_rep_agent <dbname>, “trace_log_file”, “path for the log file”
      2> go
    2. If the database uses a different method to replicate data, ensure that data is replicated by consulting the Replication Server queues. To do this, run the following Replication Server command:
      1> admin who, sqm
      2> go
  3. Use isql to update one row in a single replicated table in the primary database:
    1> update table set column = column
    2> where key = unique_value
    3> go
    The update command helps track whether all modifications to the replicated database have been sent to the Replication Server.
    Note: Sybase recommends you use a dummy table with a primary key which you define. It is recommended that you define a replication definition with all columns in the table.
  4. In the primary Replication Server, execute the admin who, sqm command until the last segment: block entry for the inbound queue changes.
  5. Execute the following Replication Server command to dump the last block of the inbound queue to the dump file you created earlier in this process:
    1> sysadmin dump_queue, queue_number,
    2> queue_type, last_seg, block, 1
    3> go
  6. Use Notepad or another text editor to examine the dump file to make sure it contains the transaction that corresponds to the update you performed above.
  7. Repeat the update steps above until the transaction that corresponds to the update is in the dump file.
  8. Stop the application or process reading the transaction log from the primary database. If you are using:
    1. Rep Agent – log into the Adaptive Server, and stop the Rep Agent:
      1> sp_stop_rep_agent database
      2> go
    2. LTM or Mirror Activator – stop them.

    After draining the transaction logs, disallow all other activity in the databases. If activity does occur, you must redrain the logs.
  9. Instruct Replication Server to reject incoming connections from Replication Agent, LTM or Mirror Activator by logging in to the Replication Server and suspending the Log Transfer connection from that database:
    1> suspend log transfer from server.database
    2> go