My Oracle Support Banner

Parallel DML/DDL using sequence produces wrong results (Doc ID 1528656.1)

Last updated on FEBRUARY 21, 2024

Applies to:

Oracle Database - Enterprise Edition - Version and later
Information in this document applies to any platform.


If dml or ddl with sequence is run in parallel,it produces wrong results.


drop table tab;
drop sequence sq;
drop type vtype;

create table tab (c1 number, c2 number);

insert into tab values(1, 2);
insert into tab values(2, 2);


alter table tab parallel 2;
alter session force parallel query parallel 1;
alter session force parallel dml parallel 2;

create table tab2 as select * from tab;

create or replace view v as
select /*+ no_parallel(tab 2) no_parallel(tab2 2) */ t2.c2
from tab t1, tab2 t2 where t1.c1 = t2.c1;
create unique index i2 on tab2(c1);

explain plan into xpl_table for
update v set c2 = sq.nextval;

execute display_plan(slave_sql=>true, clean=>true);

update v set c2 = sq.nextval;


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.