Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Partition table maintenance

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Background:

There is a large amount of useless data in the SEND_CONTROL_HIS1 partition table, which does not affect performance, but some partitions can be deleted to save storage space.

-- look up what objects are in the tablespace

Select owner,segment_name,segment_type,partition_name,bytes/1024/1024 As "occupies space M"

From dba_segments a where a.tablespaceful nameplate Portal data 'And segment_name='CONTROL_HIS1'

Order By bytes Desc

Implementation steps:

1. Delete the first-half partition of the table

For details, please refer to the attached 2:TRACK_PART19. The previous data partition can be deleted.

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. Clear the partition of the table in June

For details, please refer to the attached 2:TRACK_PART24. The previous data partition can be 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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report