Understanding about Oracle fragmentation and Solutions

Source: Internet
Author: User

The Oracle database consists of three tablespaces: tablespace, systemspace, and tempspace.
A tablespace contains segments, and segments contain multiple ranges (extent) and
Freespace. when data is stored, segments first initialize the storage location range for storage
Store and search, and mark the range of storage locations as 1.

Because when storing data, segments always find the maximum range for themselves, which facilitates storage and searching,
After frequent data storage, there is a redundant range in the narrow area between the range and the range,
When you look for the maximum range for yourself, you need to find the maximum range for yourself.
You can imagine how long it takes to traverse the largest idle range,
Therefore, after frequent data updates, there will be a lot of redundant space fragments in the space.

The following methods can be used to address the storage principles and features:

1. Set the range flag to 1, because SMON periodically merges the positions of the same flag
This reduces redundant fragments and improves data addressing efficiency and storage efficiency.
Change to 1 automatic merge: Alter tablespace users default storage (pctincrease 1)
Manual merge: Alter tablespace users coalesce

2. A simple way to compress data into a range is to use the correct storage parameters to recreate the segment, and then
Import data from the old table to the new table and delete the old table. Use export/import to achieve this goal.
First exp DPS/DPS file = mesdb. dmp compress = y grants = y indexes = y
And then import it. The exported table is the latest table and data after reconstruction, and the range is also the largest.

 

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.