Draining Out Corrupt Data

Use a customized function string to drain corrupted data out of the queues if you do not disable replication of off-row compressed LOB columns.

  1. Disable replication of compressed LOB columns:
    sp_setrepcol table_name, lob_column_name, ‘do_not_replicate’
  2. Disable high-volume adaptive replication (HVAR) on the replicate Replication Server.
    For example, to disable HVAR for a database connection, enter:
    alter connection to data_server.database
    set dsi_compile_enable to ‘off’
    go
    See alter connection in the Replication Server Reference Manual and Enable HVAR in the Replication Server Administration Guide: Volume 2.
  3. If the DSI thread shuts down, use a customized function string to drain corrupted data from the queue.
    For example, using the table schema in the mytab5 table and a replication definition named reptab5, create a function string named reptab5.rs_insert based on the rs_insert function:
    • Table schema:
      create table mytab5
      (c1 int primary key, c2 text null compressed = 5) 
    • Replication definition:
      create replication definition reptab5 
      with primary at repl3_18540.pdb
      with all tables named mytab5
      (c1 int, c2 image null) 
      primary key (c1) 
    • Customized function string:
      alter function string reptab5.rs_insert
      for rs_sqlserver_function_class
      output language
      'insert mytab5(c1, c2) values(?c1!new? , '''')'