Oracle allows duplicated records even if there is Primary key and Unique index -
Oracle allows duplicated records even if there is Primary key and Unique index -
i using oraclebulkcopy insert records oracle database in batches of 3. in table, duplicated records inserted first batch, fail next. first batch should fail since should not allow duplicated entries! below may find table 'create script' (i have removed of fields).
any ideas?
-------------------------------------------------------- -- ddl table cheques -------------------------------------------------------- create table "dbousb"."cheques" ( "recordid" number(38,2), "cheque_number" varchar2(8 char), "scanning_date" varchar2(19 char), ) segment creation immediate pctfree 10 pctused 40 initrans 1 maxtrans 255 nocompress logging storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default) tablespace "users" lob ("msgnumbers") store basicfile ( tablespace "users" enable storage in row chunk 8192 retention nocache logging storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default)) lob ("docstype") store basicfile ( tablespace "users" enable storage in row chunk 8192 retention nocache logging storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default)) lob ("docspagestype") store basicfile ( tablespace "users" enable storage in row chunk 8192 retention nocache logging storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default)) lob ("imageslink") store basicfile ( tablespace "users" enable storage in row chunk 8192 retention nocache logging storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default)) lob ("images") store basicfile ( tablespace "users" enable storage in row chunk 8192 retention nocache logging storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default)) ; -------------------------------------------------------- -- ddl index cheques_pk -------------------------------------------------------- create unique index "dbousb"."cheques_pk" on "dbousb"."cheques" ("recordid") pctfree 10 initrans 2 maxtrans 255 compute statistics storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default) tablespace "users" ; alter index "dbousb"."cheques_pk" unusable; -------------------------------------------------------- -- constraints table cheques -------------------------------------------------------- alter table "dbousb"."cheques" add together constraint "cheques_pk" primary key ("recordid") using index pctfree 10 initrans 2 maxtrans 255 compute statistics storage(initial 65536 next 1048576 minextents 1 maxextents 2147483645 pctincrease 0 freelists 1 freelist groups 1 buffer_pool default flash_cache default cell_flash_cache default) tablespace "users" alter index "dbousb"."cheques_pk" unusable; enable; alter table "dbousb"."cheques" modify ("recordid" not null enable);
i suspect problem lying in fact cheques_pk
index in unusable
state.
oracle
Comments
Post a Comment