ORA-14402 updating partition key column

做DBA几年来,经常遇到项目到了维护期总是修改表的结构,原因很简单,就是随着数据量越来越大,对表的访问越来越慢。

故这次趁着割接,把这些表重新规划下。不过有个同事在进行划分分区表时,偏偏喜欢用状态字段做分区key,原因是每个月需要出报表,统计数据方便。

据我了解:
1)这个状态字段,根据业务变化,要经过从0到1,最终状态是3
2)而且从表的数据在这个状态字段上的分布了解到,最终状态3占到95%的数据

对partition key 进行update会报错,同时也会影响性能。这样的事情,费力不讨好,但是偏偏有人喜好。

I cannot reproduce, works as supposed for me...What version are you on ?

1 create table t (x number, y char(10))
2 partition by range (x) (
3 partition p1 values less than (100),
4 partition p2 values less than (maxvalue)
5* )
test@CENTRAL> /

Table created.

test@CENTRAL> select table_name, row_movement from user_tables where table_name='T';

TABLE_NAME ROW_MOVE
------------------------------ --------
T DISABLED

test@CENTRAL>
test@CENTRAL> insert into t values (10,'a');

1 row created.

test@CENTRAL> commit;

Commit complete.

test@CENTRAL> update t set x = 110 ;
update t set x = 110
*
ERROR at line 1:
[color=red]ORA-14402: updating partition key column would cause a partition change[/color]


test@CENTRAL> alter table t enable row movement;

Table altered.

test@CENTRAL> update t set x = 110 ;

1 row updated.

test@CENTRAL> commit;

Commit complete.

test@CENTRAL> alter table t disable row movement;

Table altered.

test@CENTRAL> select table_name, row_movement from user_tables where table_name='T';

TABLE_NAME ROW_MOVE
------------------------------ --------
T DISABLED

test@CENTRAL> update t set x = 10;
update t set x = 10
*
ERROR at line 1:
ORA-14402: updating partition key column would cause a partition change


test@CENTRAL>


Stefan


On 5/2/06, hamid alavi <alavihamid@gmail.com> wrote:
List,

I have partition table and I did alter table table_name enable rowmovement, then when I try to Disable row movement still when I update the partition key the record updated means the disable does not work & I can not disable row movement afte enableing it, any idea?
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值