【mysql表分区增加分区】遇到PMORE分区或者PMAX分区如何扩展分区MySQL 分区表增加分区
背景
⽇志分区表,按⽉分区,在5年前创建分区表的时候,已经创建了5年60个分区,系统经过5年运⾏,⽇志表分区马上就满了,且当时未完善分区表⾃动扩展分区的功能,现需要在当前分区的情况下增加分区。
增加分区
-- 增加分区
alter table t_trans_log add partition(
ubuntu开启ssh服务PARTITION`P2302`VALUES LESS THAN ('2023-03-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2303`VALUES LESS THAN ('2023-04-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
htmlinput标签怎么用PARTITION`P2304`VALUES LESS THAN ('2023-05-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2305`VALUES LESS THAN ('2023-06-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2306`VALUES LESS THAN ('2023-07-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2307`VALUES LESS THAN ('2023-08-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2308`VALUES LESS THAN ('2023-09-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2309`VALUES LESS THAN ('2023-10-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2310`VALUES LESS THAN ('2023-11-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2311`VALUES LESS THAN ('2023-12-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2312`VALUES LESS THAN ('2024-01-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0
);
若原本分区中有PMORE分区,或者有PMAX分区,通过上述⽅法,则会报错:
1481- MAXVALUE can only be used in last partition definition
解决⽅案:
alter table t_fop_trans_log REORGANIZE PARTITION PMORE INTO(
PARTITION`P2201`VALUES LESS THAN ('2022-02-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2202`VALUES LESS THAN ('2022-03-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,人工客服
批处理if语句的嵌套
PARTITION`P2203`VALUES LESS THAN ('2022-04-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,mysql面试题2202
PARTITION`P2204`VALUES LESS THAN ('2022-05-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
jfreechart组织结构图PARTITION`P2205`VALUES LESS THAN ('2022-06-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2206`VALUES LESS THAN ('2022-07-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2207`VALUES LESS THAN ('2022-08-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2208`VALUES LESS THAN ('2022-09-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2209`VALUES LESS THAN ('2022-10-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2210`VALUES LESS THAN ('2022-11-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2211`VALUES LESS THAN ('2022-12-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION`P2212`VALUES LESS THAN ('2023-01-01')ENGINE=InnoDB MAX_ROWS =0 MIN_ROWS =0,
PARTITION PMORE VALUES LESS THAN MAXVALUE ENGINE=InnoDB
);
完美解决。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论