您好,登錄后才能下訂單哦!
背景:
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;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。