assign action

Assigns Replication Server error-handling actions to data server or Replication Server errors received by the DSI thread.

Syntax

assign action 
   {ignore | warn | retry_forever | retry_log | log | retry_stop | stop_replication}
   for error_class 
   to server_error1 [, server_error2]...

Parameters

Examples

Usage

  • Use assign action to tell Replication Server how to handle errors returned by data servers. This command overrides any action previously assigned to a data server error.

  • Execute assign action at the primary site where the create error class was executed.

  • Row count validation error messages display table names in Replication Server 15.6 and later. See the Replication Server Administration Guide Volume 2 > Errors and Exception Handling > Data Server Error Handling > Row Count Validation for non-SQL Statement Replication > Table Names Display in Row Count Validation Error Messages .
  • Assign actions for an error class before you create any distributions that use the error class. Assigning actions for an active distribution can lead to unpredictable results.

  • If a data server error has no action assigned, the default action stop_replication is taken. For Replication Server errors, the default action taken depends on the type of error that occurred. See Updates to Replication Server error class error numbers for a list of supported Replication Server errors and the default actions for these errors.

  • Be sure to assign error actions that are appropriate for the error condition. For example, if you assign the ignore action to an error returned by the data server when a begin transaction command fails, the subsequent commit or rollback command may generate an unexpected error.

  • Data servers return errors to Replication Server through the Client/Server Interfaces error-handling mechanism. Warnings and error messages are written to the Replication Server log file.

  • Replication Server distributes error actions to qualifying sites through the replication system. The changes do not appear immediately because of normal replication system lag time.

Error Actions with Multiple Errors

  • When an operation results in multiple errors, Replication Server chooses the most severe action to perform for the set of errors. For example, if one error indicates that a transaction has been rolled back and is assigned the retry_log action, and another error indicates that the transaction log is full and is assigned the stop_replication action, a transaction that returns both errors causes Replication Server to perform the stop_replication action. The severity of the error actions, from least severe to most severe, are as follows:

    1. ignore

    2. warn

    3.retry_forever

    4. retry_log

    5. log

    6. retry_stop

    7. stop_replication

Error Actions for rs_sqlserver_error_class

  • Predefined error actions for Adaptive Servers are provided with the rs_sqlserver_error_class error class.

  • To assign different error actions in the rs_sqlserver_error_class, you must first choose a primary site for the error class. Log into the Replication Server at that site and create the error class using create error class.

Error Actions for rs_repserver_error_class

  • Predefined error actions for Replication Server are provided with the rs_repserver_error_class error class.

  • To assign different error actions to the rs_repserver_error_class, you must first choose a primary site for the error class. Log in to the Replication Server at the primary site and create the error class using create replication server error class.

  • "Updates to Replication Server Error Class Error Numbers" table lists the valid Replication Server errors and their default error actions.

    Updates to Replication Server Error Class Error Numbers

    server_error

    Error Message

    Default Error Action

    Description

    5185

    Row count mismatch for the command executed on ‘dataserver.database’. The command impacted x rows but it should impact y rows.

    stop_replication

    This message appears if the affected number of rows is different from the expected number of rows, after a command that is not part of SQL Statement Replication, or a stored procedure, or a row change with autocorrection enabled is sent to the data server.

    5186

    Row count mismatch for the command executed on ‘dataserver.database’. The command impacted x rows but it should impact y rows.

    stop_replication

    Row count verification error for SQL statement replication if the affected number of rows is different from what is expected.

    5187

    Row count mismatch for the autocorrection delete command executed on ‘dataserver.database'. The command deleted x rows but it should delete y rows.

    stop_replication

    This message appears if the affected number of rows is different from the expected number of rows, after a delete command is sent to the data server, and if autocorrection is enabled.

    5193

    You cannot enable autocorrection if SQL Statement Replication is enabled. Either enable SQL Statement Replication only or disable SQL StatementReplication before you enable autocorrection.

    stop_replication

    Cannot enable autocorrection if SQL statement replication is enabled. Either enable SQL statement replication only or disable SQL statement replication before you enable autocorrection

    5203

    Row count mismatch on ‘dataserver.database’. The delete command generated by dsi_command_convert deleted x rows, whereas it should delete y rows.

    stop_replication

    This message appears if the number of rows deleted is different from the expected number of rows to be deleted.

  • For information about rs_repserver_error_class see "Error and Function Classes" table.

Displaying Error Actions

The rs_helperror stored procedure displays the Replication Server error actions mapped to a given data server error number.

Permissions

assign action requires "sa" permission.

Related reference
alter error class
configure connection
create connection
create error class
drop error class
rs_helperror
suspend connection