mysql的数据归档

一、背景:

1、当前生产环境中日志表已经高达20亿,容量超过500GB,索引查询效率明显降低。需要进行归档。

二、解决方案:

pt_archiver 

优势:

免费

操作简单

下载地址:

https://www.percona.com/downloads

三、操作命令

./pt-archiver --source h=10.0.0.1,P=3306,u=READ,p='PASSWORD',D=DB1,t=TABLE_log --where "create_time