ORA-30344: number of child cols different from number of parent level cols ORACLE 报错 故障修复 远程处理

文档解释

ORA-30344: number of child cols different from number of parent level cols

Cause: The number of child columns specified in a JOIN KEY clause is not the same as the number of columns in the specified parent level.

Action: Check the child columns and the columns in the definition of the referenced parent level and correct the discrepency.

ORA-30344 错误指出,使用二级分区表结构定义时,子表级别要求与父表级别列数不一致。

官方解释

ORA-30344: number of child cols different from number of parent level cols

被定义的子表的级别的列数必须与父表的级别的列数完全一致。

例子:

父表定义:

CREATE TABLE PARENT_TABLE (

ID NUMBER,

CUSTOMER_ID NUMBER,

SEQ NUMBER

);

子表:

CREATE TABLE CHILD_TABLE (

ID NUMBER,

CUSTOMER_ID NUMBER

);

在这种情况下,查询:

ALTER TABLE CHILD_TABLE

partition by range (CUSTOMER_ID)

subpartition by list (SEQ)

(PARTITION P1 VALUES LESS THAN (10)

(SUBPARTITION P1S1 VALUES (1), P1S2 VALUES (2)));

就会产生ORA-30344:number of child cols different from number of parent level cols 错误。这是因为子表没有定义SEQ列,而父表却定义了该列。

一般处理方法及步骤

1.确保子表的列数与父表的级别的列数完全一致。

2.如果必须使用部分不同的列,则可以将记录放入null空间,以使子表与父表列数一致:

ALTER TABLE CHILD_TABLE

partition by range (CUSTOMER_ID)

subpartition by list (SEQ)

(PARTITION P1 VALUES LESS THAN (10)

(SUBPARTITION P1S1 VALUES (1, NULL), P1S2 VALUES (2, NULL) );


数据运维技术 » ORA-30344: number of child cols different from number of parent level cols ORACLE 报错 故障修复 远程处理