时间:2021-07-01 10:21:17 帮助过:9人阅读
追加分区
alter table tb_pub_app_income add PARTITION( PARTITION p201801 VALUES LESS THAN (‘2018-2-1‘) );
追加分区时报 VALUES LESS THAN value must be strictly increasing for each partition 错的原因是 最后分区太大了 ,将对应分区删除即可
/*!50500 PARTITION BY RANGE COLUMNS(end_date) (PARTITION p0 VALUES LESS THAN (‘2016-10-1‘) ENGINE = InnoDB, PARTITION p201610 VALUES LESS THAN (‘2016-11-1‘) ENGINE = InnoDB, PARTITION p201611 VALUES LESS THAN (‘2016-12-1‘) ENGINE = InnoDB, PARTITION p201612 VALUES LESS THAN (‘2017-1-1‘) ENGINE = InnoDB, PARTITION p201701 VALUES LESS THAN (‘2017-2-1‘) ENGINE = InnoDB, PARTITION p201702 VALUES LESS THAN (‘2017-3-1‘) ENGINE = InnoDB, PARTITION p201703 VALUES LESS THAN (‘2017-4-1‘) ENGINE = InnoDB, PARTITION p201704 VALUES LESS THAN (‘2017-5-1‘) ENGINE = InnoDB, PARTITION p201705 VALUES LESS THAN (‘2017-6-1‘) ENGINE = InnoDB, PARTITION p201706 VALUES LESS THAN (‘2017-7-1‘) ENGINE = InnoDB, PARTITION p201707 VALUES LESS THAN (‘2017-8-1‘) ENGINE = InnoDB, PARTITION p201708 VALUES LESS THAN (‘2017-9-1‘) ENGINE = InnoDB, PARTITION p201709 VALUES LESS THAN (‘2017-10-1‘) ENGINE = InnoDB, PARTITION p201710 VALUES LESS THAN (‘2017-11-1‘) ENGINE = InnoDB, PARTITION p201711 VALUES LESS THAN (‘2017-12-1‘) ENGINE = InnoDB, PARTITION p201712 VALUES LESS THAN (‘2018-1-1‘) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB) */;
删除分区
alter table tb_pub_app_income drop PARTITION p1;
参考资料:
1、http://blog.csdn.net/tjcyjd/article/details/11194489
2、 http://bbs.csdn.net/topics/390121058
mysql 分区
标签:ict partition innodb inno log tail sql bsp add