ORA-14185: incorrect physical attribute specified for this index partition

本文介绍如何解决Oracle中分区索引迁移至不同表空间时遇到的ORA-14086及ORA-14185错误。通过使用正确的语法进行分区索引重建,并详细解释了有效选项和无效选项的区别。
部署运行你感兴趣的模型镜像

要将一个分区索引挪到指定的表空间,首先检查一下:

Segment Name                Size In MB Tablespace Name      Segment Type
--------------------------- ---------- -------------------- ------------------
MISC16.PK_SERVSTAT                   6 INDEX_HIS02          INDEX PARTITION
MISC16.PK_SERVSTAT                   6 INDEX_HIS03          INDEX PARTITION

直接使用alter index ... rebuild tablespace ...肯定是不行的,你会收到ORA-14086报错,例如:
SQL> alter index MISC16TEST.PK_SERVSTAT rebuild tablespace DATA_DYNAMIC nologging;
alter index MISC16TEST.PK_SERVSTAT rebuild tablespace DATA_DYNAMIC nologging
                       *
ERROR at line 1:
ORA-14086: a partitioned index may not be rebuilt as a whole


SQL>

我们需要使用:
ALTER INDEX <索引名称> REBUILD PARTITION <索引分区名称> [tablespace 表空间] [nologging];
语法来重建分区索引:
SQL> ALTER INDEX MISC16TEST.PK_SERVSTAT REBUILD PARTITION IDX_SERVSTAT_P3 tablespace DATA_DYNAMIC nologging;
ALTER INDEX MISC16TEST.PK_SERVSTAT REBUILD PARTITION IDX_SERVSTAT_P3 tablespace DATA_DYNAMIC nologging
                                                     *
ERROR at line 1:
ORA-14185: incorrect physical attribute specified for this index partition

SQL>

关于ORA-14185 的解释:
Error: ORA-14185
Text: incorrect physical attribute specified for this index partition
---------------------------------------------------------------------------
Cause: unexpected option was encountered while parsing physical attributes of
 a local index partition; valid options for Range or Composite Range
 partitions are INITRANS, MAXTRANS, TABLESPACE, STORAGE, PCTFREE,
 PCTUSED, LOGGING and TABLESPACE; but only TABLESPACE may be specified
 for Hash partitions STORE IN () is also disallowed for all but
 Composite Range partitions
Action: remove invalid option(s) from the list of physical attributes of an
 index partition


总结:
这个 ORA-14185 其实是oracle的 Bug 1890073:

一般来说,带有下面这些的选项的rebuild index语句会遇到ORA-14185错误:
logging 
nologging 
initrans 10 
maxtrans 10
compress  
nocompress
storage (next 1m)
storage (buffer_pool default)

而带有下面这些的选项的rebuild index语句则不会遇到ORA-14185错误:
parallel 
noparallel
pctfree 10
compute statistics 
online  
tablespace system 

例如:
SQL> ALTER INDEX PK_SERVSTAT REBUILD PARTITION IDX_SERVSTAT_P3 tablespace DATA_DYNAMIC;

Index altered.

SQL>

 

 

您可能感兴趣的与本文相关的镜像

Dify

Dify

AI应用
Agent编排

Dify 是一款开源的大语言模型(LLM)应用开发平台,它结合了 后端即服务(Backend as a Service) 和LLMOps 的理念,让开发者能快速、高效地构建和部署生产级的生成式AI应用。 它提供了包含模型兼容支持、Prompt 编排界面、RAG 引擎、Agent 框架、工作流编排等核心技术栈,并且提供了易用的界面和API,让技术和非技术人员都能参与到AI应用的开发过程中

评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值