Assigns Replication Server error-handling actions to data server or Replication Server errors received by the DSI thread.
assign action {ignore | warn | retry_log | log | retry_stop | stop_replication} for error_class to server_error1 [, server_error2]...
Instructs Replication Server to ignore the error and continue processing. ignore should be used when the data server error code indicates a successful execution or an inconsequential warning.
Instructs Replication Server to display a warning message in its log file without rolling back the transaction or interrupting execution.
Instructs Replication Server to roll back the transaction and retry it. The number of retry attempts is set with alter connection. If the error continues after retrying, Replication Server writes the transaction in the exceptions log and executes the next transaction.
Instructs Replication Server to roll back the current transaction, log it in the exceptions log, and then execute the next transaction.
Instructs Replication Server to roll back the transaction and retry it. The number of retry attempts is set with the alter connection. If the error continues after retrying, Replication Server suspends replication for the database.
Instructs Replication Server to roll back the current transaction and suspend replication for the database. This action is equivalent to using suspend connection.
The error class name for which the action is being assigned.
A data server or Replication Server error number.
Instructs Replication Server to ignore data server errors 5701 and 5703:
assign action ignore for pubs2_db_err_class to 5701, 5703
Stops replication if Replication Server encounters row count errors, which is indicated by error number 5186:
assign action stop_replication for rs_repserver_error_class to 5186
If there is a row count error, this error message displays:
DSI_SQLDML_ROW_COUNT_INVALID 5186 Row count mismatch for the SQL Statement Replication command executed on 'mydataserver.mydatabase'. The command impacted 10 rows but it should impact 15 rows."
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.
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 Table 3-17 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.
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_log
4. log
5. retry_stop
6. stop_replication
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.
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.
Table 3-17 lists the valid Replication Server errors and their default error actions.
Replication Server error number |
Description |
Default error action |
---|---|---|
5186 |
Row count verification error for SQL statement replication if the affected number of rows is different from what is expected. |
stop replication |
5193 |
You cannot enable autocorrection if SQL statement replication is enabled. Either enable SQL statement replication only or disable SQL statement replication before you enable autocorrection. |
stop replication |
For information about rs_repserver_error_class see Table 3-23.
The rs_helperror stored procedure displays the Replication Server error actions mapped to a given data server error number.
assign action requires "sa" permission.
configure connection, create connection, create error class, drop error class, rs_helperror, suspend connection