There's no good solution to this in 11g. You have to manually consume the sequence values up to the current PK max by calling sequence.nextval or drop/recreate the sequence.
From 12c you can define identity columns. These use sequences under the covers. And you can bump them up to the current highest value in the column with alter table:
create table t (
c1 int
generated by default as identity
primary key
);
begin
for i in 1 .. 9 loop
insert into t values ( default );
end loop;
insert into t values ( 10 );
insert into t values ( 20 );
commit;
end;
/
insert into t values ( default );
ORA-00001: unique constraint (CHRIS.SYS_C0024541) violated
alter table t
modify c1
generated by default as identity (
start with limit value
);
var id number;
insert into t values ( default )
returning c1 into :id;
print :id
ID
----------
21
Or from 18c you can use the restart clause to set the nextval:
create sequence s;
select s.nextval from dual;
NEXTVAL
1
alter sequence s
restart start with 99;
select s.nextval from dual;
drop sequence s;
NEXTVAL
99