1.用存储过程让myseq序列归0
declare
n number(10);
tsql varchar2(100);
begin
select MYSEQ.nextval into n from dual;
n:=-(n-1);
tsql:='alter sequence MYSEQ increment by'|| n;
execute immediate tsql;
select MYSEQ.nextval into n from dual;
tsql:='alter sequence MYSEQ increment by 1';
execute immediate tsql;
end;
/
2.重建序列
drop sequence seq_name;
create sequence seq_name
start with 0
minvalue 0