0
点赞
收藏
分享

微信扫一扫

datax抄写oracle抛出错误ORA-32795说明

一只1994 2022-08-01 阅读 92


1.在使用datax抄写的时候出现如下抛错:

2021-10-29 15:49:01.201 [0-0-0-writer] WARN  CommonRdbmsWriter$Task - 回滚此次写入, 采用每次写入一行方式提交. 因为:ORA-32795: cannot insert into a generated always identity column
2021-10-29 15:49:01.205 [0-0-0-writer] ERROR StdoutPluginCollector -
java.sql.SQLException: ORA-32795: cannot insert into a generated always identity column

2.查看表结构

create table hbhe.T1
(
type VARCHAR2(20) not null,
subject VARCHAR2(200),
od_date DATE not null,
id NUMBER(18) generated always as identity (start with 1)
)
tablespace hbhe_T1_TBS
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 80K
next 1M
minextents 1
maxextents unlimited
);
-- Add comments to the columns
comment on column hbhe.t1.type
is '0:为假日工作,1为工作日放假';
-- Create/Recreate indexes
create unique index hbhe.t1_PK1 on hbhe.t1 (ID)
tablespace hbhe_DATA_TBS
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Create/Recreate primary, unique and foreign key constraints
alter table hbhe.t1
add constraint t1_PK primary key (ID);

3.禁用identity

alter table T1 modify id drop identity;

4.如果需要添加

alter table hbhe.t1 modify id generated always as identity;

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle,linux

举报

相关推荐

0 条评论