High watermark for Oracle Clear table

Source: Internet
Author: User

when you add a record, HWM slowly moves up, but when you delete a record, HWM does not move down. Therefore, deleting large amounts of data with the delete from command can cause performance problems caused by HWM. The most straightforward way to delete a high water level is to truncate Table but this way is too violent, so use the following method to remove the high watermark.
--delete dataDELETE from Gjds_bus_oil_logWHERE VERSION < (13112-100);
--Fast compression
Move is best done when you are free to remember move is a TM lock will be generated after the move to remember to rebuild index
ALTER TABLE gjds_bus_oil_log MOVE;
--All indexes will be invalidated after compression, and the index needs to be rebuiltALTER INDEX index_name REBUILD;
--then analyze the table belowANALYZE table Gjds_bus_oil_log COMPUTE STATISTICS for TABLE for all INDEXES for all INDEXED COLUMNS;
--View the total number of blocksSELECT segment_name, extents, BLOCKSFrom user_segmentsWHERE segment_name = ' gjds_bus_oil_log ';--View high water levelSELECT BLOCKS, Empty_blocksFrom dba_tablesWHERE table_name = ' Gjds_bus_oil_log 'and OWNER = ' BUS ';--See how many blocks are actually usedSELECT COUNT (DISTINCT dbms_rowid. Rowid_block_number (ROWID)) Used_blockFrom Gjds_bus_oil_log S;
Another way is to use shrink SPACEShrink SPACE cannot be used in the following casesIOT Mapping Tables
Tables with ROWID based materialized views
Tables with function-based indexes     --Function Index
securefile lobs
Compressed Tables
If a function index is required to delete the function index, you can use the--Enable row movementALTER TABLE gjds_bus_oil_log ENABLE ROW movement;--Compression SectionALTER TABLE gjds_bus_oil_log SHRINK SPACE;also need to rebuild indexes and re-parse tables
Reference: Http://www.blogjava.net/decode360/archive/2009/07/14/287767.html

High watermark for Oracle Clear table

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.