码迷,mamicode.com
首页 > 其他好文 > 详细

percona-toolkit之pt-online-schema-change在线修改表结构

时间:2015-12-28 18:48:48      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:pt-online-schema-change

[root@BJ-ECS-XHM-TEST-YL-19 bin]# ./pt-online-schema-change --user=checksums --password=checksums  --recursion-method="processlist"    --alter="add column birth3 int" h=10.50.12.33,P=3336,D=gaoquan,t=t1 --execut

Found 2 slaves:

  BJ-ECS-XHM-TEST-YL-21.domain.com

  BJ-ECS-XHM-TEST-YL-20.domain.com

Will check slave lag on:

  BJ-ECS-XHM-TEST-YL-21.domain.com

  BJ-ECS-XHM-TEST-YL-20.domain.com

Operation, tries, wait:

  analyze_table, 10, 1

  copy_rows, 10, 0.25

  create_triggers, 10, 1

  drop_triggers, 10, 1

  swap_tables, 10, 1

  update_foreign_keys, 10, 1

Altering `gaoquan`.`t1`...

Creating new table...

Created new table gaoquan._t1_new OK.

Waiting forever for new table `gaoquan`.`_t1_new` to replicate to BJ-ECS-XHM-TEST-YL-20.domain.com...

Altering new table...

Altered `gaoquan`.`_t1_new` OK.

2015-12-28T15:13:58 Creating triggers...

2015-12-28T15:13:58 Created triggers OK.

2015-12-28T15:13:58 Copying approximately 4 rows...

2015-12-28T15:13:58 Copied rows OK.

2015-12-28T15:13:58 Analyzing new table...

2015-12-28T15:13:58 Swapping tables...

2015-12-28T15:13:58 Swapped original and new tables OK.

2015-12-28T15:13:58 Dropping old table...

2015-12-28T15:13:58 Dropped old table `gaoquan`.`_t1_old` OK.

2015-12-28T15:13:58 Dropping triggers...

2015-12-28T15:13:58 Dropped triggers OK.

Successfully altered `gaoquan`.`t1`.


percona-toolkit之pt-online-schema-change在线修改表结构

标签:pt-online-schema-change

原文地址:http://gaoquan.blog.51cto.com/4503718/1729168

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!