| | 54 | |
| | 55 | 5. Archive partition base on [https://mysql.dbgeekgirl.com/2018/12/exchange-partition-archiving-strategy.html here]. First, we create a table like payments2 |
| | 56 | {{{ |
| | 57 | mysql> create table payments_2004 like payments2; |
| | 58 | }}} |
| | 59 | |
| | 60 | 6. We remove partition from new table that we create |
| | 61 | {{{ |
| | 62 | mysql> alter table payments_2004 remove partitioning; |
| | 63 | }}} |
| | 64 | |
| | 65 | 7. We move partition of payments2 to payments_2004 |
| | 66 | {{{ |
| | 67 | mysql> alter table payments2 exchange partition p2004 with table payments_2004; |
| | 68 | }}} |
| | 69 | |
| | 70 | 8. To move back from payments_2004 to partition p2004 in payment2 |
| | 71 | {{{ |
| | 72 | mysql> alter table payments3 exchange partition p2004 with table payments_2004; |
| | 73 | }}} |
| | 74 | |