目前想将分区表A修改分区方式,原来按照字段col1分区,现修改为按col2分区。所以对某A表做移行过程中出现如下问题,请各位帮忙分析一下会是什么原因:
1、rename A to A_temp;
2、重建分区表A,建主键,其中字段和主键跟A_temp完全一致;
3、insert /*+ append*/ into A select * from A_temp;执行到这步时报主键冲突。
后来采用另外一种方式:
1、rename A to A_temp;
2、重建分区表A,其中字段和主键跟A_temp完全一致;这一步没有建主键约束
3、insert /*+ append*/ into A select * from A_temp;
4、对A表建唯一键约束(和A_temp一致)。报错。
后来发现表A比表A_temp多一条记录a,其余完全一致。但是记录a在表A_temp中明明是不存在的,且记录a和A_temp表中记录b主键是一致的,其中部分字段有差异。
对该问题比较困惑,这条记录a会是从哪里钻出来的恩,各位达人帮忙分析一下原因。谢谢!
Append should have no relationship with the values of record. This hint just used to restrict the data to be inserted to be placed at the end of the table. HWM will be increased after using APPEND hint. And it doesn't use free space in the eariler blocks in segment. So it's no effect with the row contents inside table.
原帖由 rollingpig 于 2008-4-29 16:38 发表
1、rename A to A_temp;
2、重建分区表A,建主键,其中字段和主键跟A_temp完全一致;
2.5 truncate table A
3、insert /*+ append*/ into A select * from A_temp;执行到这步时报主键冲突。