ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-14402处理,关于分区字段的修改

ORA-14402处理,关于分区字段的修改

原创 Linux操作系统 作者:feilo4r 时间:2010-06-28 13:45:44 0 删除 编辑
        今天在生产上执行一个update,报出ORA-14402: updating partition key column would cause a partition change。原因是修改分区字段所引起的。

update schema.table_name
   set time_a = time_b
 where code_a = xxxxxxxxxxxxxxxx
   and status = xxx
   and to_char(time_a, 'dd') != to_char(time_b, 'dd')
   and time_a > to_date('2010-06-01', 'yyyy-mm-dd');

        1.仔细的看了看该表,是以time_a 为分区字段,5天一个分区。而update的语句中有将6号的时间改为5号的日期的情况。

        2.然后查询一下生产的row movement策略
        select table_name,owner,row_movement from dba_tables where table_name = 'table_name';
        的确是disabled的状态

        3.修改该策略
        alter table schema.table_name enable row movement;

        4.执行语句

        5..修改回来
        alter table schema.table_name disable row movement;

        搞完收工

        另:其实这个不是万全之策,如果偶尔的修改没有问题;如果要经常修改,则说明该表设计的不好,分区字段一般是不能用于修改的。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11258275/viewspace-666497/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-09-19

  • 博文量
    33
  • 访问量
    97928