Rename Partition in Mysql Database

Example:

In this example I have renamed a single partition from P_2017_2 to P_2017_02

ALTER TABLE alarm.alarm_log
REORGANIZE PARTITION P_2017_2 INTO (
PARTITION P_2017_02 VALUES LESS THAN (1484521200)
);


In this example I have renamed multiple partitions.


ALTER TABLE alarm.alarm_log
REORGANIZE PARTITION P_2017_3,P_2017_4,P_2017_5,P_2017_6,P_2017_7,P_2017_8,P_2017_9 INTO (
 PARTITION P_2017_03 VALUES LESS THAN (1485126000),
 PARTITION P_2017_04 VALUES LESS THAN (1485730800),
 PARTITION P_2017_05 VALUES LESS THAN (1486335600),
 PARTITION P_2017_06 VALUES LESS THAN (1486940400),
 PARTITION P_2017_07 VALUES LESS THAN (1487545200),
 PARTITION P_2017_08 VALUES LESS THAN (1488150000),
 PARTITION P_2017_09 VALUES LESS THAN (1488754800)
);

Comments