Created
May 29, 2015 11:45
-
-
Save liujingyu/fe26c5e410f09b15bfff to your computer and use it in GitHub Desktop.
InnoDB表结构在线更改工具
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
随着互联网应用的发展,MySQL数据库的使用也越来越广泛,但是在使用过程中存在或这样或那样的棘手的问题, | |
其中在线更改表结构和索引,MySQL最好用的存储引擎InnoDB会将所有的写堵塞掉,进一步会堵塞读,从而造成线上业务的不可用, | |
这在很多情况下是不可接受的。 | |
为了避免这种情况,一直以来可以通过主从复制加以解决,但是操作相对复杂,对于面对成百上千的MySQL数据库,显然成本太高。 | |
为了解决这一矛盾,已经有前人做了工作,我们后人可以乘凉了,下面两款工具,可以帮助解决在有主键的情况下,在线更改表结构。 | |
Python写的 oak-online-alter-table | |
https://code.google.com/p/openarkkit/source/browse/trunk/openarkkit/src/oak/oak-online-alter-table.py | |
PHP写的 Online Schema Change for MySQL (OSC) | |
http://bazaar.launchpad.net/~mysqlatfacebook/mysqlatfacebook/tools/annotate/head:/osc/OnlineSchemaChange.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pt-online-schema-change 也是一个