Skip to Main Content
  • Questions
  • Cannot alter Oracle sequence start with

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Cyrus.

Asked: June 10, 2021 - 8:48 am UTC

Last updated: June 10, 2021 - 12:50 pm UTC

Version: 19c

Viewed 1000+ times

You Asked

I have tried altering the start with value of an Oracle sequence but I face
[ORA-02283: cannot alter starting sequence number] error.

I tried to find why Oracle does not allow the same but I could not find an appropriate answer for that.
So my question is why is it that Oracle does not let you change a sequence start with value?

(PS: I am hoping there should be a really solid technical reason behind this)

Thanks in advance!



and Chris said...

Please give an example ( create sequence + alter sequence ) showing how you're hitting this error.

The following works for me:
create sequence s;

select s.nextval from dual;

NEXTVAL   
         1 

alter sequence s
  restart start with 10;
  
select s.nextval from dual;

NEXTVAL   
        10 


Please also confirm which version you're using - this feature was added in 18c.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

Design

New to good database design? Check out Chris Saxon's full fundamentals class.