assign action

Description

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

Syntax

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

Parameters

ignore

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.

warn

Instructs Replication Server to display a warning message in its log file without rolling back the transaction or interrupting execution.

retry_log

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.

log

Instructs Replication Server to roll back the current transaction, log it in the exceptions log, and then execute the next transaction.

retry_stop

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.

stop_replication

Instructs Replication Server to roll back the current transaction and suspend replication for the database. This action is equivalent to using suspend connection.

error_class

The error class name for which the action is being assigned.

server_error

A data server or Replication Server error number.

Examples

Example 1

Instructs Replication Server to ignore data server errors 5701 and 5703:

assign action ignore
 for pubs2_db_err_class
 to 5701, 5703

Example 2

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."

Usage


Error actions with multiple errors


Error actions for rs_sqlserver_error_class


Error actions for rs_repserver_error_class


Displaying error actions

Permissions

assign action requires "sa" permission.

See also

configure connection, create connection, create error class, drop error class, rs_helperror, suspend connection