Examining the exceptions log

If a transaction is skipped, either explicitly using the resume connection command with the skip transaction option, or as a result of the log action assigned to data server errors, the skipped transaction is written into the exceptions log. Orphan transactions and transactions logged by the sysadmin log_first_tran command are also in the exceptions log.

If a replicate database is not receiving updates, it is possible that the update transactions were skipped and written into the exceptions log. Examine the exceptions log to find out what transactions have been logged.

The exception log consists of three tables: rs_exceptshdr, rs_exceptscmd, and rs_systext. The rs_exceptshdr table has one entry for each transaction. The rs_exceptscmd table has one entry for each command (either source or output) of the transaction. The rs_systext table stores the text of the commands.

To view the header information for all logged transactions intended for a database, log in to the system Adaptive Server for the Replication Server controlling the database, and execute the following query against the RSSD:

select * from rs_exceptshdr
     where error_site = data_server
    and error_db = database
    order by log_time

The rows are returned in ascending order, by the time the transactions were logged. If you want the rows to appear in descending order, attach “desc” to the end of the query.

Join the three system tables to view all information about a transaction in the log. The following query gives the source commands and their corresponding output commands for each logged transaction:

select hdr.sys_trans_id, cmd_type, textval
     from rs_exceptshdr hdr,
         rs_exceptscmd cmd,
         rs_systext
     where error_site = data_server
       and error_db = database
        and hdr.sys_trans_id = cmd.sys_trans_id
         and cmd_id = parentid
     order by log_time, src_cmd_line,
         output_cmd_index, sequence

For more information about the system tables that make up the exceptions log, see the Replication Server Reference Manual.