Partition Fast Split 不起作用时应检查的内容 (Doc ID 378138.1)

时间:2019-12-31
本文章向大家介绍Partition Fast Split 不起作用时应检查的内容 (Doc ID 378138.1),主要包括Partition Fast Split 不起作用时应检查的内容 (Doc ID 378138.1)使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

What to Check When Partition Fast Split does Not Appear Working (Doc ID 378138.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.2.0.7 and later
Information in this document applies to any platform.

GOAL

What to check when the fast split partitioning does not appear as working?  快速拆分分区无法正常工作时该怎么检查

SOLUTION

First of all, fast split partitioning is a feature that can only be used for heap tables starting with the release 9.2 and for IOTs starting with release 10.2. It cannot be used for indexes or any other storage objects.  首先,快速拆分分区是一项功能,只能用于从9.2版开始的堆表和从10.2版开始的IOT。它不能用于索引或任何其他存储对象

In order to be able to perform such an operation, the following things have to be respected:  为了能够执行这样的操作,必须注意以下几点
1. According to the documentation:  
"Fast split partitioning takes advantage of those situations in which a split partition results in all rows being moved to a single partition. If all the rows map into a single partition and if the segment attributes of the old partition and the segment attributes of the partition inheriting all the rows match, then the database simply reuses the old segment and adds an empty segment for the other partition. Another benefit of this is that global indexes do not have to be invalidated and, in certain cases, local index partitions corresponding to the new partitions are also usable."
Thus, the new partitions should have the same storage configuration as the original partition.

“快速拆分分区利用了以下情况:拆分分区导致所有行都移到单个分区。如果所有行都映射到单个分区,并且旧分区的段属性和分区的段属性 继承所有行匹配的内容,数据库将简单地重用旧段并为另一个分区添加一个空段,这样做的另一个好处是不必使全局索引无效,并且在某些情况下,本地索引分区对应于 新的分区也可以使用。” 因此,新分区应具有与原始分区相同的存储配置。

2. The COMPATIBLE parameter should be set to 9.2.0.0.0 for heap tables. This is a new feature in 9.2 but applies only to heap tables under this release.  对于堆表,COMPATIBLE参数应设置为9.2.0.0.0。 这是9.2中的新功能,但仅适用于此版本下的堆表。
The same feature has been implemented for IOTs in 10.2, thus, for IOTs the operation would only succeed in 10.2 and only when COMPATIBLE is set to 10.2.0.0.0 minimum.  在10.2中为IOT实现了相同的功能,因此,对于IOT,该操作仅在10.2中且仅当COMPATIBLE设置为最低10.0.2.0.0时才能成功

3. Statistics should be accurate  统计信息应准确

Accurate statistics should be gathered not just on the (sub)partition to be split, but on the indexes of the table as well.  准确的统计信息不仅应收集在要拆分的(子)分区上,还应收集表的索引。
The reason for this is that oracle executes recursive queries on the (sub)partition to be split in order to see the number of rows < AT <value> and >= AT <value>, so that it can be determined whether one of the resulting partitions is empty.  原因是oracle在要拆分的(子)分区上执行递归查询,以便查看行数<AT <value>和> = AT <value>,以便可以确定是否其中一个结果分区为空。

Accurate statistics are important in order to avoid suboptimal execution plan for any of these recursive SQLs.  准确的统计信息对于避免任何这些递归SQL的执行计划都不理想非常重要。


4. If the above conditions are met, and the fast split is still not performed, trace the fast split in the following way.  如果满足上述条件,但仍不执行快速拆分,请按照以下方式跟踪快速拆分

The resulting trace file should give the reason for the fast split failure as well as where the time is taken.  生成的跟踪文件应说明快速拆分失败的原因以及花费的时间

ALTER SESSION SET tracefile_identifier='MYTRACE';
ALTER SESSION SET MAX_DUMP_FILE_SIZE = unlimited;
ALTER SESSION SET events '10046 TRACE NAME CONTEXT FOREVER, LEVEL 12';
alter session set events '14525 trace name context forever, level 2';
run the split operation here

You can check if fast split was done or not by looking at the dba_extents view before and after the split.  您可以通过查看拆分前后的dba_extents视图来检查是否已完成快速拆分。
One of the resulting partitions which contains the data after the split should have identical file_id,extent_id and block_id with the original partition.  包含分割后数据的结果分区之一应具有与原始分区相同的file_id,extent_id和block_id。

Note that starting from 12.1 there is no segment created for a resulting partition that is empty.  请注意,从12.1开始,没有为空分区生成分区。

原文地址:https://www.cnblogs.com/zylong-sys/p/12123177.html