Classes and system tables

The system-provided function-string classes and error class do not initially have a designated primary site, that is, their site ID equals 0. The classes rs_default_function_class and rs_db2_function_class cannot be modified, and thus can never have a designated primary site. The classes rs_sqlserver_function_class and rs_sqlserver_error_class may be assigned a primary site and modified. The primary site of a derived function-string class is the same as its parent class.

If the recovering Replication Server was made the primary site for a function-string class or error class since the last transaction dump, the rs_subcmp procedure described earlier in this section would find orphaned rows in downstream RSSDs.

In that event, run rs_subcmp again on the rs_classes, rs_erroractions, rs_funcstrings, and rs_systext system tables. Set prsid = 0 in order to repopulate these tables with the necessary default settings. For example, use the following select statement for the rs_classes table:

select * from rs_classes where prsid = 0
    order by primary_keys

Example

Suppose you have the following Replication Server sites in your replication system, where an arrow (→) indicates a route. Site B is the failed site, and there are no indirect routes.

These Replication Servers have the following site IDs:

In this example, to bring the RSSDs to a consistent state, you would perform the following tasks, in the order presented, on the rs_classes, rs_columns, rs_databases, rs_erroractions, rs_funcstrings, rs_functions, rs_objects, and rs_systext system tables.


Reconciling with upstream RSSDs

  1. Run rs_subcmp against the above tables, specifying site B as the replicate and site A as the primary, with prsid = 1 in the where clauses. For example, the select statement for rs_columns should look like the following:

    select * from rs_columns where prsid in
        (select source_rsid from rs_routes
        where
            (through_rsid = 1 or through_rsid = 2)
             and dest_rsid = 2)
            and rowtype = 1
           order by objid, colname
    
  2. Run rs_subcmp against the above tables, specifying site B as the replicate and site C as the primary, with prsid = 3 in the where clauses. For example, the select statement for rs_columns should look like the following:

    select * from rs_columns where prsid in
          (select source_rsid from rs_routes
           where
            (through_rsid = 3 or through_rsid = 2)
             and dest_rsid = 2)
           and rowtype = 1
          order by objid, colname
    

Reconciling downstream RSSDs

  1. Run rs_subcmp against the above tables, specifying site B as the primary and site E as the replicate, with prsid = 2 in the where clauses. For example, the select statement for rs_columns should look like the following:

    select * from rs_columns where prsid in
          (select source_rsid from rs_routes
           where
            (through_rsid = 2 or through_rsid = 5)
             and dest_rsid = 5)
           and rowtype = 1
          order by objid, colname
    

Refer to Chapter 7, “Executable Programs,” in the Replication Server Reference Manual for more information on rs_subcmp. Refer to Chapter 8, “Replication Server System Tables,” in the Replication Server Reference Manual for more information on the RSSD system tables.