无法使用的分区 Oracle / datastage
Unusable partition Oracle / datastage
我的数据阶段工作遇到问题。我必须从 .csv
文件中填写 Oracle 中的 table ttperiodeas
。此屏幕截图显示了 Oracle 连接器中的 SQL 查询:
Oracle connector
这里是 oracle 脚本
CREATE TABLE TTPERIODEAS
(
CDPARTITION VARCHAR2(5 BYTE) NOT NULL ENABLE,
CDCOMPAGNIE NUMBER(4,0) NOT NULL ENABLE,
CDAPPLI NUMBER(4,0) NOT NULL ENABLE,
NUCONTRA CHAR(15 BYTE) NOT NULL ENABLE,
DTDEBAS NUMBER(8,0) NOT NULL ENABLE,
DTFINAS NUMBER(8,0) NOT NULL ENABLE,
TAUXAS NUMBER(8,5) NOT NULL ENABLE,
CONSTRAINT PK_TTPERIODEAS
PRIMARY KEY (CDPARTITION, CDCOMPAGNIE, CDAPPLI, NUCONTRA, DTDEBAS)
)
PARTITION BY LIST(CDPARTITION)
(PARTITION P_PERIODEAS_13Q VALUES ('13Q'));
当 运行 作业时,我收到以下消息错误并且 table 未填写。:
The index 'USINODSD0.SYS_C00249007' its partition is unusable
我需要帮助谢谢
消息说给定分区的索引不可用:因此您可以尝试使用
重建相应的索引分区
create index [index_name] rebuild partition [partition_name]
(具有 [index_name]
和 [partition_nme]
的拟合值。
在执行此操作之前,您应该检查 user_indexes
中索引分区的状态 - 因为您的错误消息看起来不像 Oracle 错误消息通常那样。
但是由于 William Robertson 指出该索引是全局的,因此这不适用于给定的情况。
索引是全局的(即未分区),因为定义末尾没有using index local
。上面显示的 PK 指数也是如此。 (我假设它们是两个不同的东西,因为默认情况下上面的 DDL 会创建一个名为 PK_TTPERIODEAS
的索引,所以我不确定 SYS_C00249007
是什么。)如果你可以删除并重建它们作为本地索引(即分区以匹配 table)然后截断或删除分区将不再使索引无效。
例如,您可以将主键重建为:
alter table ttperiodeas
drop primary key;
alter table ttperiodeas
add constraint pk_ttperiodeas primary key (cdpartition,cdcompagnie,cdappli,nucontra,dtdebas)
using index local;
我不知道 SYS_C00249007
是如何定义的,但你可以使用类似的东西。
create table
命令可能类似于:
create table ttperiodeas
( cdpartition varchar2(5 byte) not null
, cdcompagnie number(4,0) not null
, cdappli number(4,0) not null
, nucontra varchar2(15 byte) not null
, dtdebas number(8,0) not null
, dtfinas number(8,0) not null
, tauxas number(8,5) not null
, constraint pk_ttperiodeas
primary key (cdpartition,cdcompagnie,cdappli,nucontra,dtdebas)
using index local
)
partition by list(cdpartition)
( partition p_periodeas_13q values ('13Q') );
或者,您可以在删除分区时添加 update global indexes
子句:
alter table demo_temp drop partition p_periodeas_14q update global indexes;
(顺便说一下,NUCONTRA
可能应该是一个标准的 VARCHAR2
而不是 CHAR
,它旨在实现跨平台兼容性和 ANSI 完整性,实际上只是浪费space 并产生错误。)
我的数据阶段工作遇到问题。我必须从 .csv
文件中填写 Oracle 中的 table ttperiodeas
。此屏幕截图显示了 Oracle 连接器中的 SQL 查询:
Oracle connector
这里是 oracle 脚本
CREATE TABLE TTPERIODEAS
(
CDPARTITION VARCHAR2(5 BYTE) NOT NULL ENABLE,
CDCOMPAGNIE NUMBER(4,0) NOT NULL ENABLE,
CDAPPLI NUMBER(4,0) NOT NULL ENABLE,
NUCONTRA CHAR(15 BYTE) NOT NULL ENABLE,
DTDEBAS NUMBER(8,0) NOT NULL ENABLE,
DTFINAS NUMBER(8,0) NOT NULL ENABLE,
TAUXAS NUMBER(8,5) NOT NULL ENABLE,
CONSTRAINT PK_TTPERIODEAS
PRIMARY KEY (CDPARTITION, CDCOMPAGNIE, CDAPPLI, NUCONTRA, DTDEBAS)
)
PARTITION BY LIST(CDPARTITION)
(PARTITION P_PERIODEAS_13Q VALUES ('13Q'));
当 运行 作业时,我收到以下消息错误并且 table 未填写。:
The index 'USINODSD0.SYS_C00249007' its partition is unusable
我需要帮助谢谢
消息说给定分区的索引不可用:因此您可以尝试使用
重建相应的索引分区create index [index_name] rebuild partition [partition_name]
(具有 [index_name]
和 [partition_nme]
的拟合值。
在执行此操作之前,您应该检查 user_indexes
中索引分区的状态 - 因为您的错误消息看起来不像 Oracle 错误消息通常那样。
但是由于 William Robertson 指出该索引是全局的,因此这不适用于给定的情况。
索引是全局的(即未分区),因为定义末尾没有using index local
。上面显示的 PK 指数也是如此。 (我假设它们是两个不同的东西,因为默认情况下上面的 DDL 会创建一个名为 PK_TTPERIODEAS
的索引,所以我不确定 SYS_C00249007
是什么。)如果你可以删除并重建它们作为本地索引(即分区以匹配 table)然后截断或删除分区将不再使索引无效。
例如,您可以将主键重建为:
alter table ttperiodeas
drop primary key;
alter table ttperiodeas
add constraint pk_ttperiodeas primary key (cdpartition,cdcompagnie,cdappli,nucontra,dtdebas)
using index local;
我不知道 SYS_C00249007
是如何定义的,但你可以使用类似的东西。
create table
命令可能类似于:
create table ttperiodeas
( cdpartition varchar2(5 byte) not null
, cdcompagnie number(4,0) not null
, cdappli number(4,0) not null
, nucontra varchar2(15 byte) not null
, dtdebas number(8,0) not null
, dtfinas number(8,0) not null
, tauxas number(8,5) not null
, constraint pk_ttperiodeas
primary key (cdpartition,cdcompagnie,cdappli,nucontra,dtdebas)
using index local
)
partition by list(cdpartition)
( partition p_periodeas_13q values ('13Q') );
或者,您可以在删除分区时添加 update global indexes
子句:
alter table demo_temp drop partition p_periodeas_14q update global indexes;
(顺便说一下,NUCONTRA
可能应该是一个标准的 VARCHAR2
而不是 CHAR
,它旨在实现跨平台兼容性和 ANSI 完整性,实际上只是浪费space 并产生错误。)