• 分区表的维护 ORA14402 更新分区关键字列


    在使用分区表时,需要注意的一个问题是,当我们更新分区字段时,可能会遇到如下错误:

    SQL> update DOM_REAL_CATEGORY_FL set doc_level=101 where doc_level=51;
    update DOM_REAL_CATEGORY_FL set doc_level=101 where doc_level=51
    *
    ERROR at line 1:
    ORA-14402: updating partition key column would cause a partition change

    这个错误的解释是:

    ORA-14402: updating partition key column would cause a partition change
    Cause: An UPDATE statement attempted to change the value of a partition key column causing migration of the row to another partition
    Action: Do not attempt to update a partition key column or make sure that the new partition key is within the range containing the old partition key.

    为了解决这个问题,可以使用如下命令更改分区表的属性:

    SQL> alter table DOM_REAL_CATEGORY_FL enable row movement;

    Table altered.

    更改分区表的分区键值,意味着要删除记录并重新插入一条新的记录,这会引起记录(Record)的移动,记录的Rowid会改变,相关索引需要进行维护。

    SQL> update DOM_REAL_CATEGORY_FL set doc_level=101 where doc_level=51;

    57024 rows updated.

    Elapsed: 00:00:34.61

  • 相关阅读:
    随机生成4位验证码(包含数字, 字母)
    eval注册和登录
    51单片机中断机制(定时器/计数器)
    CS106B
    机器学习算法之旅(转载)
    Ubuntu系统使用记录
    2. 自然语言处理预备知识
    1. 自然语言处理描述
    前端学习网站
    2016年总结,2017年计划
  • 原文地址:https://www.cnblogs.com/zhangzt/p/2708166.html
Copyright © 2020-2023  润新知