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

ORACLE solves the problem of high water mark

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

Share

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

-- method one.

ALTER TABLE table_name MOVE;-- rebuilding the table

ANALYZE TABLE table_name COMPUTE STATISTICS;-- Statistical analysis

-- method two.

ALTER TABLE table_name ENABLE ROW MOVEMENT;-- Activation Line Migration

ALTER TABLE table_name SHRINK SPACE;-- activation table contraction

ANALYZE TABLE table_name COMPUTE STATISTICS;-- Statistical analysis

Disadvantages: if it is a partition table, after activation, the table data will update the disk physical location (ROWID) because of the update partition field.

Method 3:

CREATE TABLE table_name_1 AS SELECT * FROM table_name

TRUNCATE TABLE table_name

INSERT INTO table_name SELECT * FROM table_name_1

Disadvantages: troublesome, time-consuming

Method 4:

Create a new temporary table, copy the data to the temporary table, drop the source table, and rename the temporary table to the name of the source table.

Malpractice, primary key. Indexes and other objects that depend on this table need to be rebuilt.

Check method:

Through the analysis of the table block before and after the deletion of data occupation changes.

SELECT num_rows, blocks, empty_blocks FROM dba_tables WHERE owner='SDBMGR' AND table_name = 'TABLE_NAME'

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

Database

Wechat

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

12
Report