Orphaned transactions

An orphaned transaction is a transaction in an inbound stable queue that is missing a terminating commit or rollback command. Because Replication Server does not free up a queue segment until every transaction in the queue segment (or in any of the preceding queue segments) has been committed or rolled back, orphaned transactions can cause the inbound queue to fill up.

StepsChecking for orphaned transactions

  1. Log in to the Replication Server and execute admin who, sqt to display information about the stable queues at the Replication Server.

  2. Use the output from admin who, sqt to identify the entry for the inbound queue of the database whose log was truncated.

    The queue has a two-part name formed from the database ID and the queue-type identifier. For an inbound queue, the queue-type identifier is 1. For example, if the database ID is 101, the inbound queue name is 101:1.

  3. If the output for the inbound queue shows an open transaction that does not change over long periods of time, an orphaned transaction is probably in the queue. However, because it is difficult to distinguish between an orphaned transaction and a very long transaction, you must further verify that an orphaned transaction exists.

    To verify that there is an orphaned transaction:

  4. If the transaction is orphaned, use the sysadmin purge_first_open command to skip it.

  5. Use the output from dumping the stable queue to manually apply the orphaned transaction to the replicate database.