mysql已有表建分区在线重定义_MySQL秘籍 | 在线重定义分区表

[test@test ~]$ pt-online-schema-change  --charset=utf8  --user=root --socket=/tmp/mysql_3769.sock D=zhaoqing,t=test --recursion-method none --execute --no-swap-tables --no-drop-old-table --no-drop-new-table  --alter "PARTITION BY RANGE ( UNIX_TIMESTAMP(CREATE_TIME))(PARTITION p201712 VALUES LESS THAN (1514736000) ENGINE = InnoDB, PARTITION p201801 VALUES LESS THAN (1517414400) ENGINE = InnoDB)"

No slaves found.  See --recursion-method if host mysqlbackup has slaves.

Not checking slave lag because no slaves were found and --check-slave-lag was not specified.

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 `zhaoqing`.`test`...

Creating new table...

Created new table zhaoqing._test_new OK.

Altering new table...

Altered `zhaoqing`.`_test_new` OK.

2018-01-04T19:09:13 Creating triggers...

2018-01-04T19:09:13 Created triggers OK.

2018-01-04T19:09:13 Copying approximately 6181140 rows...

Copying `zhaoqing`.`test`:  23% 01:35 remain

Copying `zhaoqing`.`test`:  48% 01:02 remain

Copying `zhaoqing`.`test`:  71% 00:36 remain

Copying `zhaoqing`.`test`:  94% 00:07 remain

2018-01-04T19:11:33 Copied rows OK.

Not dropping old table because --no-drop-old-table was specified.

2018-01-04T19:11:33 Dropping triggers...

2018-01-04T19:11:33 Dropped triggers OK.

Not dropping the new table `zhaoqing`.`_test_new` because --no-drop-new-table was specified.  To drop the new table, execute:

DROP TABLE IF EXISTS `zhaoqing`.`_test_new`;

Successfully altered `zhaoqing`.`test`.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值