Querying the exceptions log system tables

You can join the rs_exceptshdr and rs_exceptscmd system tables on the sys_trans_id column.

You can also join the rs_exceptscmd and rs_systext system tables to retrieve the text of a transaction. To do this, join the cmd_id column in rs_exceptscmd to the parentid column in rs_systext.

Figure 6-1 illustrates the exceptions log system tables.

Figure 6-1: Exceptions log system tables

Figure 6-1 illustrates the exceptions log system tables

The rs_exceptshdr system table contains descriptive information about the transactions in the exceptions log, including the following:

To retrieve a list of the excepted transactions for a given database, use, for example, the following query:

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

To retrieve the source and output text for a transaction with a given system transaction ID, use:

select t.texttype, t.sequence,
 t.textval
 from rs_systext t, rs_exceptscmd e
 where e.sys_trans_id = sys_trans_id
and t.parentid = e.cmd_id
 order by e.src_cmd_line, e.output_cmd_index,
 t.sequence

Refer to Chapter 8, “Replication Server System Tables,” in the Replication Server Reference Manual for a list of all of the columns in these Replication Server system tables.