This topic describes the solutions to some common errors that occur when you submit data change tickets.
According to the configured security rules, the XXXX statement is prohibited from being executed or from being submitted.
Example of an error message:
Failed to pass the SQL statement type check. According to security rules, forbid execute directly, command type:INSERT, please contact DBA or administrator adjust! To modify the rule, choose Security and Specifications > Security Rules > Edit > SQL Correct > SQL Execution Rules., Not matched any rules of the command type, default forbid execute.
Reason: The security rule bound to a database managed in Secure Collaboration mode prohibits the SQL statement from being executed or submitted. Therefore, the statement is blocked.
Solution: The statements that are prohibited from being executed or submitted include KNOWN statements (SQL statements that can be identified by DMS) and UNKNOWN statements (SQL statements that cannot be identified by DMS). You can select a solution based on your business requirements.
KNOWN statements
DMS identifies the statement indicated in an error message as a KNOWN statement. However, the current security rule prohibits the execution of the statement by default. Contact the DBA or DMS administrator to modify the security rule. The following steps describe how to modify a security rule.
View the name of a security rule set.
Go to the Data Change Ticket Details page, and click Operation Logs in the upper-right corner to view the name of the security rule set.
Modify a security rule.
Log on to the DMS console V5.0.
In the top navigation bar, choose
.On the Security Rules tab, find the security rule set that you want to manage and click Edit in the Actions column.
In the left-side navigation pane, click SQL Correct.
Select an option for Checkpoints based on the error message that is displayed. For the preceding example of an error message, select SQL execution rules for Checkpoints.
Find the security rule that you want to modify and click Edit in the Actions column.
NoteSelect the security rule that you want to modify based on the SQL language type of the statement indicated in the error message. For example, if the statement type indicated in the error message is CREATE_INDEX, you must select a DDL-related security rule.
Add the SQL statement type indicated in the error message to the DSL syntax for the security rule.
For example, if the error message indicates that the CREATE_INDEX statement is prohibited from being executed, you must add the statement to the DDL syntax for the rule, as shown in the following figure.
Click Submit.
After you modify the security rule, click Retry in the Precheck section on the ticket details page. Then, DMS checks the statement type again.
UNKNOWN statements
Check whether the SQL statement you submit is correct. If the SQL statement is incorrect, click Modify SQL in the Precheck section. After you confirm the modification, click Retry to check the statement type again.
If the SQL statement is correct, click View Details in the Precheck section to filter and view the SQL statement identified as UNKNOWN. Then, contact the DBA or the DMS administrator to add the SQL statement identified as UNKNOWN to the security rule and allow DMS to execute the statement. After you submit the modification, click Retry. For more information about how to modify a security rule, see Modify a security rule.
Failed to check the number of affected rows. Syntax check failed.
Example of an error message:
Failed to check the number of affected rows. Syntax check failed. Error message: ERROR. pos 37, line 1, column 31, token WHERE.
Reason: In the Precheck step when you submit a data change ticket, DMS checks the number of scanned rows to check again whether the syntax of the SQL statement is correct.
Solution: Check whether the syntax of the SQL statement that you submit is correct.
If the syntax is incorrect, click Retry in the Precheck section after you modify the syntax. Then, DMS checks the number of scanned rows again.
If the syntax is correct, click Skip on the right of Check the number of scanned rows in the Precheck section to ignore the error.