This operation is not difficult because data correction is often required during work. Rollback is required during operation ~ For rollback requirements, I usually perform backup tables and then execute
This operation is not difficult because data correction is often required during work. Rollback is required during operation ~ For rollback requirements, I usually perform backup tables and then execute
This operation is not difficult because data correction is often required during work. Rollback is required during operation ~ For rollback requirements, I usually perform a backup table and then perform a change! If a correction error is sent or the user requests a rollback, the entire table is completely restored. This operation is redundant because we only need
You can select the data to be backed up for correction! For example:
Update usage_type = 'unused' and user_id = 166 to user_id = 169! 100 updates!
1. Back up the table first
Create table test. resource_20120221
Select * from resource where usage_type = 'unused' and user_id = 166 order by id limit 100;
2. perform data correction
Update resource set user_id = 169 where user_id = 166 and id in (select id from test. resource_20120221 );
If you want to roll back, you only need to execute
Update resource set user_id = 166 where id in (select id from test. resource_20120221 );
You can!
Correction of small batches of data is involved here. If a large amount of data is used, the batch submission method is required!
Attached:
DDL change techniques for M-M Architecture
L M-M replication architecture, only one provides all or primary data services
Recommended DDL statements, in the current M-M architecture is the standby Database Server priority execution, there are four advantages:
1. Data Services Provided by the database are not immediately affected;
2. Log Recovery Operations for data replication between the master and slave databases are not blocked;
3. During DDL statement execution, if a problem occurs, only the stability of the standby database is affected, but the primary database is rarely affected;
4. If there is a seamless switchover function for data services (such as heartbeat and autonomous data layer), you can switch between the master and slave databases provided by the data service after the slave database is executed, especially when a table with a large data capacity is changed, it can reduce the impact on the business and the downtime maintenance time and the number of times;
Operations