问题描述
我试图在oracle中的功能索引上创建一个分区,但失败并出现以下错误。
错误: ORA-30555: 全局索引分区键是一个表达式
语法: 在TMP_ARA上创建索引TMP_ARA_I9 (UPPER(JOB_TITLE) ASC,UPPER(COMPANY_NAME) ASC) 全局分区按哈希 (UPPER(JOB_TITLE),UPPER(COMPANY_NAME)) 分区4;
错误: ORA-30555: 全局索引分区键是一个表达式
语法: 在TMP_ARA上创建索引TMP_ARA_I9 (UPPER(JOB_TITLE) ASC,UPPER(COMPANY_NAME) ASC) 全局分区按哈希 (UPPER(JOB_TITLE),UPPER(COMPANY_NAME)) 分区4;
专家解答
如错误所暗示的,您不能使用表达式定义
但是你可以解决这个问题,但是通过使用虚拟列...
SQL> create table t as select * from dba_objects where object_id is not null;
Table created.
SQL> create index ix on t ( object_id ) global partition by hash (object_id ) partitions 2;
Index created.
SQL>
SQL> drop index ix;
Index dropped.
SQL> create index ix on t ( object_id*2 ) global partition by hash (object_id*2 ) partitions 2;
create index ix on t ( object_id*2 ) global partition by hash (object_id*2 ) partitions 2
*
ERROR at line 1:
ORA-30555: global index partitioning key is an expression
但是你可以解决这个问题,但是通过使用虚拟列...
SQL> alter table t add fbi_col generated always as (object_id*2); Table altered. SQL> create index ix on t ( fbi_col ) global partition by hash (fbi_col ) partitions 2; Index created.
文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




