Přejít na menu

Percona online schema update

Správa článků

Vyhledávání Vyhledávání
6.1.2014 09:00
,
Počet přečtení: 700

How to update the database schema without locking the table.

Principle

  1. Copy the structure of source table
  2. Alter schema of the new temp table
  3. Copy all data from the source table to the temp table

This behaviour is the same as default MySQL altering. The difference is in locking:

  • Default MySQL altering locks the source table in the begining
  • Percona Toolkit instead of locking creates triggers on the source table which will update data in the temp table when performing the whole alter.

Two excluding requirements - don't lock te source table, but ensure the data consistency.

Replications

For preserving data consistency it requires row-based replication (which replicates data states instead of statements), because toolkit is based on triggers and replications does not replicate triggers.
It is possible to switch to row-based replication temporarily.
Replications and triggers http://dev.mysql.com/doc/refman/5.1/en/replication-features-triggers.html

Source: http://www.percona.com/doc/percona-toolkit/2.1/pt-online-schema-change.html

Vytvořil 7. ledna 2014 v 07:40:05 mira. Upravováno 2x, naposledy 5. října 2015 ve 22:54:31, mira


Diskuze ke článku

Vložení nového komentáře
*
*
*