You can use the Normal Data Modify feature of Data Management Service (DMS) to change data in databases by executing SQL statements, such as INSERT, UPDATE, DELETE, and TRUNCATE. This feature allows you to initialize data, delete historical data, fix issues, or run a test. This topic describes how to change regular data in DMS.
Prerequisites
Procedure
Usage notes
- After you submit a data change ticket for approval, you can close the ticket regardless of whether the ticket is approved or rejected. This prevents the task for the ticket from being accidentally executed after the ticket is approved.
- We recommend that you submit tickets for data changes in the test environment. This
way, the system checks the number of rows to be affected and generates a backup file
for each data change. This allows you to restore data if the data change does not
meet expectations.
Note To ensure high R&D efficiency, you can specify that no approval is required for data change tickets in the test environment. For more information, see SQL Correct.
- If you have configured logical databases, logical tables, and routing algorithms in DMS, you can submit a ticket to shard databases and partition tables at the same
time. This way, you do not need to submit a ticket for each physical database or table.
- If you have configured a routing algorithm, and a routing field is included in the SQL statement that is used to shard databases and partition tables, the routing algorithm routes the statement to the corresponding physical table for execution.
- If you have not configured a routing algorithm, no routing field is included in the SQL statement, or the data type of the routing field does not match the data type that is specified in the routing algorithm, the SQL statement is executed on each table in each database one by one. This process takes a longer period of time.