The assign action command specifies the action to take for errors that a data server can return to Replication Server. The syntax for the assign action command is:
assign action {ignore | warn | retry_log | log | retry_stop | stop_replication} for error_class to server_error1 [, server_error2]...
For example, to instruct Replication Server to ignore Adaptive Server errors 5701 and 5703:
assign action ignore for rs_sqlserver_error_class to 5701, 5703
For example to warn if Replication Server encounters row count errors, which is indicated by error number 5186:
assign action warn 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."
See “Default error classes” for the default error class provided by Replication Server. See “assign action,” in Chapter 3, “Replication Server Commands” in the Replication Server Reference Manual for error actions you can assign.
You must create a default error class at a primary site before you can use the assign action command to change default error actions. The data_server_error parameter is the data server error number.
You can assign error classes to specific connections on replication databases using the create connection and alter connection commands.
Enter one of the six possible error actions at the Replication Server where the error class was created. These actions are listed in Table 6-4, in order of severity: ignore is the least severe action and stop_replication is the most severe.
When a transaction causes multiple errors, Replication Server chooses just one action—the most severe action assigned to any of the errors that occurred. To return an error to the default error action, stop_replication, you must reassign it explicitly.
Action |
Description |
---|---|
ignore |
Assume that the command succeeded and that there is no error or warning condition to process. This action can be used for a return status that indicates successful execution. |
warn |
Log a warning message, but do not roll back the transaction or interrupt execution. |
retry_log |
Roll back the transaction and retry it. The number of retry attempts is set with the configure connection command. If the error continues after retrying, write the transaction into the exceptions log, and continue, executing the next transaction. |
log |
Roll back the current transaction and log it in the exceptions log; then continue, executing the next transaction. |
retry_stop |
Roll back the transaction and retry it. The number of retry attempts is set with the configure connection command. If the error recurs after retrying, suspend replication for the database. |
stop_replication |
Roll back the current transaction and suspend replication for the database. This is equivalent to using the suspend connection command. This action is the default. Since this action stops all replication activity for the database, it is important to identify the data server errors that can be handled without shutting down the database connection, and assign them to another action. |
You can also specify how Replication Server responds to SQLDML row count errors that may occur during SQL statement replication. In SQLDML row count errors, the number of rows changed in the primary and replicate databases do not match after SQL statement replication. The Replication Server default error action is to stop replication. The default Replication Server error class is rs_repserver_error_class.
If there is a row count error, this is an example of the error message that 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.