有几张大的表,按月做分区处理,每月的数据量在2000万条左右,
现想做数据清理,只保留最近1个月的数据(测试环境)
若通过表数据删除,如:delete from ks38.tcl_his_done where busi_date<200601,
删除非常慢,删除动作运行了近12小时后,才把1年的数据清理完毕;但其中包含至少4年的数据,如何处理呢.
后通过
alter table ks38.tcl_his__done truncate partition p200601;
alter table ks38.tcl_his__done truncate partition p200604;
alter table ks38.tcl_his__done truncate partition p200603;
阅读(3400) | 评论(0) | 转发(0) |