分区表维护
背景:
SEND_CONTROL_HIS1分区表存在大量无用数据,虽不影响性能,但可以删除部分分区节省存储空间。
--查表空间有哪些对象
select owner,segment_name,segment_type,partition_name,bytes/1024/1024 As "占据空间M"
from dba_segments a where a.tablespace_name='PORT_DATA' And segment_name='CONTROL_HIS1'
Order By bytes Desc
实施步骤:
1、删除该表上半年分区
详见附表2:TRACK_PART19以前的数据分区可删除
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART4;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART5;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART6;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART7;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART8;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART9;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART10;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART11;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART12;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART13;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART14;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART15;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART16;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART17;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART18;
ALTER TABLE SEND_CONTROL_HIS1 DROP PARTITION TRACK_PART19;
2、清空该表6月份分区
详见附表2:TRACK_PART24以前的数据分区可TRUNCATE
ALTER TABLE SEND_CONTROL_HIS1 TRUNCATE PARTITION TRACK_PART20;
ALTER TABLE SEND_CONTROL_HIS1 TRUNCATE PARTITION TRACK_PART21;
ALTER TABLE SEND_CONTROL_HIS1 TRUNCATE PARTITION TRACK_PART22;
ALTER TABLE SEND_CONTROL_HIS1 TRUNCATE PARTITION TRACK_PART23;
ALTER TABLE SEND_CONTROL_HIS1 TRUNCATE PARTITION TRACK_PART24;
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341